gusucode.com > 婚纱摄影网站模版整站源码 1.1 > 婚纱摄影网站模版整站源码 1.1.3/婚纱2/ueditor/editor.min.js

    UEDITOR_CONFIG=window.UEDITOR_CONFIG||{};var baidu=window.baidu||{};window.baidu=baidu;window.UE=baidu.editor={};UE.plugins={};UE.commands={};UE.instants={};UE.I18N={};UE.version="1.2.3.0";var dom=UE.dom={};var browser=UE.browser=function(){var d=navigator.userAgent.toLowerCase(),b=window.opera,c={ie:!!window.ActiveXObject,opera:(!!b&&b.version),webkit:(d.indexOf(" applewebkit/")>-1),mac:(d.indexOf("macintosh")>-1),quirks:(document.compatMode=="BackCompat")};c.gecko=(navigator.product=="Gecko"&&!c.webkit&&!c.opera);var a=0;if(c.ie){a=parseFloat(d.match(/msie (\d+)/)[1]);c.ie9Compat=document.documentMode==9;c.ie8=!!document.documentMode;c.ie8Compat=document.documentMode==8;c.ie7Compat=((a==7&&!document.documentMode)||document.documentMode==7);c.ie6Compat=(a<7||c.quirks)}if(c.gecko){var e=d.match(/rv:([\d\.]+)/);if(e){e=e[1].split(".");a=e[0]*10000+(e[1]||0)*100+(e[2]||0)*1}}if(/chrome\/(\d+\.\d)/i.test(d)){c.chrome=+RegExp["\x241"]}if(/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(d)&&!/chrome/i.test(d)){c.safari=+(RegExp["\x241"]||RegExp["\x242"])}if(c.opera){a=parseFloat(b.version())}if(c.webkit){a=parseFloat(d.match(/ applewebkit\/(\d+)/)[1])}c.version=a;c.isCompatible=!c.mobile&&((c.ie&&a>=6)||(c.gecko&&a>=10801)||(c.opera&&a>=9.5)||(c.air&&a>=1)||(c.webkit&&a>=522)||false);return c}();var ie=browser.ie,webkit=browser.webkit,gecko=browser.gecko,opera=browser.opera;var utils=UE.utils={makeInstance:function(b){var a=new Function();a.prototype=b;b=new a;a.prototype=null;return b},extend:function(d,e,a){if(e){for(var c in e){if(!a||!d.hasOwnProperty(c)){d[c]=e[c]}}}return d},isArray:function(a){return Object.prototype.toString.apply(a)==="[object Array]"},isString:function(a){return typeof a=="string"||a.constructor==String},inherits:function(d,b){var a=d.prototype,c=utils.makeInstance(b.prototype);utils.extend(c,a,true);d.prototype=c;return(c.constructor=d)},bind:function(a,b){return function(){return a.apply(b,arguments)}},defer:function(b,a,c){var d;return function(){if(c){clearTimeout(d)}d=setTimeout(b,a)}},indexOf:function(e,d,a){for(var c=a||0,b=e.length;c<b;c++){if(e[c]===d){return c}}return -1},findNode:function(b,a,e){for(var d=0,c;c=b[d++];){if(e?e(c):this.indexOf(a,c.tagName.toLowerCase())!=-1){return c}}},removeItem:function(d,c){for(var b=0,a=d.length;b<a;b++){if(d[b]===c){d.splice(b,1);b--}}},trim:function(a){return a.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g,"")},listToMap:function(c){if(!c){return{}}c=utils.isArray(c)?c:c.split(",");for(var b=0,a,d={};a=c[b++];){d[a.toUpperCase()]=d[a]=1}return d},unhtml:function(b,a){return b?b.replace(a||/[&<">]/g,function(c){return{"<":"&lt;","&":"&amp;",'"':"&quot;",">":"&gt;"}[c]}):""},html:function(a){return a?a.replace(/&((g|l|quo)t|amp);/g,function(b){return{"&lt;":"<","&amp;":"&","&quot;":'"',"&gt;":">"}[b]}):""},cssStyleToDomStyle:function(){var b=document.createElement("div").style,a={"float":b.cssFloat!=undefined?"cssFloat":b.styleFloat!=undefined?"styleFloat":"float"};return function(c){return a[c]||(a[c]=c.toLowerCase().replace(/-./g,function(d){return d.charAt(1).toUpperCase()}))}}(),loadFile:function(){var a={};return function(g,f,b){var d=a[f.src||f.href];if(d){if(utils.isArray(d.funs)){d.ready?b():a[f.src||f.href].funs.push(b)}return}a[f.src||f.href]=b?{funs:[b]}:1;if(!g.body){g.write('<script src="'+f.src+'"><\/script>');return}if(f.id&&g.getElementById(f.id)){return}var c=g.createElement(f.tag);delete f.tag;for(var e in f){c.setAttribute(e,f[e])}c.onload=c.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){d=a[f.src||f.href];if(d.funs){d.ready=1;for(var h;h=d.funs.pop();){h()}}c.onload=c.onreadystatechange=null}};g.getElementsByTagName("head")[0].appendChild(c)}}(),isEmptyObject:function(b){for(var a in b){return false}return true},isFunction:function(a){return"[object Function]"==Object.prototype.toString.call(a)},fixColor:function(b,d){if(/color/i.test(b)&&/rgba?/.test(d)){var e=d.split(",");if(e.length>3){return""}d="#";for(var c=0,a;a=e[c++];){a=parseInt(a.replace(/[^\d]/gi,""),10).toString(16);d+=a.length==1?"0"+a:a}d=d.toUpperCase()}return d},optCss:function(e){var d,c,a;e=e.replace(/(padding|margin|border)\-([^:]+):([^;]+);?/gi,function(i,g,f,h){if(h.split(" ").length==1){switch(g){case"padding":!d&&(d={});d[f]=h;return"";case"margin":!c&&(c={});c[f]=h;return"";case"border":return h=="initial"?"":i}}return i});function b(m,h){if(!m){return""}var i=m.top,f=m.bottom,g=m.left,j=m.right,n="";if(!i||!g||!f||!j){for(var k in m){n+=";"+h+"-"+k+":"+m[k]+";"}}else{n+=";"+h+":"+(i==f&&f==g&&g==j?i:i==f&&g==j?(i+" "+g):g==j?(i+" "+g+" "+f):(i+" "+j+" "+f+" "+g))+";"}return n}e+=b(d,"padding")+b(c,"margin");return e.replace(/^[ \n\r\t;]*|[ \n\r\t]*$/,"").replace(/;([ \n\r\t]+)|\1;/g,";").replace(/(&((l|g)t|quot|#39))?;{2,}/g,function(g,f){return f?f+";;":";"})},domReady:function(){var b=false,a=[];function c(){b=true;for(var d;d=a.pop();){d()}}return function(d){if(document.readyState==="complete"){return d&&setTimeout(d,1)}d&&a.push(d);b&&c();if(browser.ie){(function(){if(b){return}try{document.documentElement.doScroll("left")}catch(e){setTimeout(arguments.callee,0);return}c()})();window.attachEvent("onload",c)}else{document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);c()},false);window.addEventListener("load",c,false)}}}()};utils.domReady();var EventBase=UE.EventBase=function(){};EventBase.prototype={addListener:function(b,d){b=utils.trim(b).split(" ");for(var a=0,c;c=b[a++];){getListener(this,c,true).push(d)}},removeListener:function(b,d){b=utils.trim(b).split(" ");for(var a=0,c;c=b[a++];){utils.removeItem(getListener(this,c)||[],d)}},fireEvent:function(d){d=utils.trim(d).split(" ");for(var c=0,f;f=d[c++];){var e=getListener(this,f),g,b,a;if(e){a=e.length;while(a--){b=e[a].apply(this,arguments);if(b!==undefined){g=b}}}if(b=this["on"+f.toLowerCase()]){g=b.apply(this,arguments)}}return g}};function getListener(d,b,c){var a;b=b.toLowerCase();return((a=(d.__allListeners||c&&(d.__allListeners={})))&&(a[b]||c&&(a[b]=[])))}var dtd=dom.dtd=(function(){function W(B){for(var A in B){B[A.toUpperCase()]=B[A]}return B}function a(E){var B=arguments;for(var D=1;D<B.length;D++){var A=B[D];for(var C in A){if(!E.hasOwnProperty(C)){E[C]=A[C]}}}return E}var z=W({isindex:1,fieldset:1}),y=W({input:1,button:1,select:1,textarea:1,label:1}),x=a(W({a:1}),y),w=a({iframe:1},x),v=W({hr:1,ul:1,menu:1,div:1,blockquote:1,noscript:1,table:1,center:1,address:1,dir:1,pre:1,h5:1,dl:1,h4:1,noframes:1,h6:1,ol:1,h1:1,h3:1,h2:1}),u=W({ins:1,del:1,script:1,style:1}),t=a(W({b:1,acronym:1,bdo:1,"var":1,"#":1,abbr:1,code:1,br:1,i:1,cite:1,kbd:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,dfn:1,span:1}),u),s=a(W({sub:1,img:1,embed:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1}),t),r=a(W({p:1}),s),q=a(W({iframe:1}),s,y),n=W({img:1,embed:1,noscript:1,br:1,kbd:1,center:1,button:1,basefont:1,h5:1,h4:1,samp:1,h6:1,ol:1,h1:1,h3:1,h2:1,form:1,font:1,"#":1,select:1,menu:1,ins:1,abbr:1,label:1,code:1,table:1,script:1,cite:1,input:1,iframe:1,strong:1,textarea:1,noframes:1,big:1,small:1,span:1,hr:1,sub:1,bdo:1,"var":1,div:1,object:1,sup:1,strike:1,dir:1,map:1,dl:1,applet:1,del:1,isindex:1,fieldset:1,ul:1,b:1,acronym:1,a:1,blockquote:1,i:1,u:1,s:1,tt:1,address:1,q:1,pre:1,p:1,em:1,dfn:1}),m=a(W({a:0}),q),k=W({tr:1}),j=W({"#":1}),i=a(W({param:1}),n),h=a(W({form:1}),z,w,v,r),g=W({li:1}),f=W({style:1,script:1}),e=W({base:1,link:1,meta:1,title:1}),d=a(e,f),c=W({head:1,body:1}),b=W({html:1});var l=W({address:1,blockquote:1,center:1,dir:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,isindex:1,menu:1,noframes:1,ol:1,p:1,pre:1,table:1,ul:1}),o=W({area:1,base:1,br:1,col:1,hr:1,img:1,input:1,link:1,meta:1,param:1,embed:1});return W({$nonBodyContent:a(b,c,e),$block:l,$inline:m,$body:a(W({script:1,style:1}),l),$cdata:W({script:1,style:1}),$empty:o,$nonChild:W({iframe:1,textarea:1}),$listItem:W({dd:1,dt:1,li:1}),$list:W({ul:1,ol:1,dl:1}),$isNotEmpty:W({table:1,ul:1,ol:1,dl:1,iframe:1,area:1,base:1,col:1,hr:1,img:1,embed:1,input:1,link:1,meta:1,param:1}),$removeEmpty:W({a:1,abbr:1,acronym:1,address:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,"var":1}),$removeEmptyBlock:W({p:1,div:1}),$tableContent:W({caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1,table:1}),$notTransContent:W({pre:1,script:1,style:1,textarea:1}),html:c,head:d,style:j,script:j,body:h,base:{},link:{},meta:{},title:j,col:{},tr:W({td:1,th:1}),img:{},embed:{},colgroup:W({thead:1,col:1,tbody:1,tr:1,tfoot:1}),noscript:h,td:h,br:{},th:h,center:h,kbd:m,button:a(r,v),basefont:{},h5:m,h4:m,samp:m,h6:m,ol:g,h1:m,h3:m,option:j,h2:m,form:a(z,w,v,r),select:W({optgroup:1,option:1}),font:m,ins:m,menu:g,abbr:m,label:m,table:W({thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,tfoot:1}),code:m,tfoot:k,cite:m,li:h,input:{},iframe:h,strong:m,textarea:j,noframes:h,big:m,small:m,span:W({"#":1,br:1}),hr:m,dt:m,sub:m,optgroup:W({option:1}),param:{},bdo:m,"var":m,div:h,object:i,sup:m,dd:h,strike:m,area:{},dir:g,map:a(W({area:1,form:1,p:1}),z,u,v),applet:i,dl:W({dt:1,dd:1}),del:m,isindex:{},fieldset:a(W({legend:1}),n),thead:k,ul:g,acronym:m,b:m,a:a(W({a:1}),q),blockquote:a(W({td:1,tr:1,tbody:1,li:1}),h),caption:m,i:m,u:m,tbody:k,s:m,address:a(w,r),tt:m,legend:m,q:m,pre:a(t,x),p:a(W({a:1}),m),em:m,dfn:m})})();function getDomNode(g,h,b,a,e,f){var d=a&&g[h],c;!d&&(d=g[b]);while(!d&&(c=(c||g).parentNode)){if(c.tagName=="BODY"||f&&!f(c)){return null}d=c[b]}if(d&&e&&!e(d)){return getDomNode(d,h,b,false,e)}return d}var attrFix=ie&&browser.version<9?{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder"}:{tabindex:"tabIndex",readonly:"readOnly"},styleBlock=utils.listToMap(["-webkit-box","-moz-box","block","list-item","table","table-row-group","table-header-group","table-footer-group","table-row","table-column-group","table-column","table-cell","table-caption"]);var domUtils=dom.domUtils={NODE_ELEMENT:1,NODE_DOCUMENT:9,NODE_TEXT:3,NODE_COMMENT:8,NODE_DOCUMENT_FRAGMENT:11,POSITION_IDENTICAL:0,POSITION_DISCONNECTED:1,POSITION_FOLLOWING:2,POSITION_PRECEDING:4,POSITION_IS_CONTAINED:8,POSITION_CONTAINS:16,fillChar:ie&&browser.version=="6"?"\ufeff":"\u200B",keys:{8:1,46:1,16:1,17:1,18:1,37:1,38:1,39:1,40:1,13:1},getPosition:function(f,d){if(f===d){return 0}var b,e=[f],c=[d];b=f;while(b=b.parentNode){if(b===d){return 10}e.push(b)}b=d;while(b=b.parentNode){if(b===f){return 20}c.push(b)}e.reverse();c.reverse();if(e[0]!==c[0]){return 1}var a=-1;while(a++,e[a]===c[a]){}f=e[a];d=c[a];while(f=f.nextSibling){if(f===d){return 4}}return 2},getNodeIndex:function(b,c){var d=b,a=0;while(d=d.previousSibling){if(c&&d.nodeType==3){continue}a++}return a},inDoc:function(a,b){while(a=a.parentNode){if(a===b){return true}}return false},findParent:function(c,a,b){if(!domUtils.isBody(c)){c=b?c:c.parentNode;while(c){if(!a||a(c)||this.isBody(c)){return a&&!a(c)&&this.isBody(c)?null:c}c=c.parentNode}}return null},findParentByTagName:function(c,b,a,d){if(c&&c.nodeType&&!this.isBody(c)&&(c.nodeType==1||c.nodeType)){b=utils.listToMap(utils.isArray(b)?b:[b]);c=c.nodeType==3||!a?c.parentNode:c;while(c&&c.tagName&&c.nodeType!=9){if(d&&d(c)){break}if(b[c.tagName]){return c}c=c.parentNode}}return null},findParents:function(e,d,a,c){var b=d&&(a&&a(e)||!a)?[e]:[];while(e=domUtils.findParent(e,a)){b.push(e)}return c?b:b.reverse()},insertAfter:function(b,a){return b.parentNode.insertBefore(a,b.nextSibling)},remove:function(b,c){var a=b.parentNode,d;if(a){if(c&&b.hasChildNodes()){while(d=b.firstChild){a.insertBefore(d,b)}}a.removeChild(b)}return b},getNextDomNode:function(d,a,b,c){return getDomNode(d,"firstChild","nextSibling",a,b,c)},isBookmarkNode:function(a){return a.nodeType==1&&a.id&&/^_baidu_bookmark_/i.test(a.id)},getWindow:function(a){var b=a.ownerDocument||a;return b.defaultView||b.parentWindow},getCommonAncestor:function(f,d){if(f===d){return f}var e=[f],c=[d],b=f,a=-1;while(b=b.parentNode){if(b===d){return b}e.push(b)}b=d;while(b=b.parentNode){if(b===f){return b}c.push(b)}e.reverse();c.reverse();while(a++,e[a]===c[a]){}return a==0?null:e[a-1]},clearEmptySibling:function(d,b,c){function a(g,e){var f;while(g&&!domUtils.isBookmarkNode(g)&&(domUtils.isEmptyInlineElement(g)||!new RegExp("[^\t\n\r"+domUtils.fillChar+"]").test(g.nodeValue))){f=g[e];domUtils.remove(g);g=f}}!b&&a(d.nextSibling,"nextSibling");!c&&a(d.previousSibling,"previousSibling")},split:function(d,f){var e=d.ownerDocument;if(browser.ie&&f==d.nodeValue.length){var c=e.createTextNode("");return domUtils.insertAfter(d,c)}var a=d.splitText(f);if(browser.ie8){var b=e.createTextNode("");domUtils.insertAfter(a,b);domUtils.remove(b)}return a},isWhitespace:function(a){return !new RegExp("[^ \t\n\r"+domUtils.fillChar+"]").test(a.nodeValue)},getXY:function(b){var a=0,c=0;while(b.offsetParent){c+=b.offsetTop;a+=b.offsetLeft;b=b.offsetParent}return{x:a,y:c}},on:function(f,e,d){var c=utils.isArray(e)?e:[e],a=c.length;if(a){while(a--){e=c[a];if(f.addEventListener){f.addEventListener(e,d,false)}else{if(!d._d){d._d={}}var b=e+d.toString();if(!d._d[b]){d._d[b]=function(g){return d.call(g.srcElement,g||window.event)};f.attachEvent("on"+e,d._d[b])}}}}f=null},un:function(f,e,d){var c=utils.isArray(e)?e:[e],a=c.length;if(a){while(a--){e=c[a];if(f.removeEventListener){f.removeEventListener(e,d,false)}else{var b=e+d.toString();f.detachEvent("on"+e,d._d?d._d[b]:d);if(d._d&&d._d[b]){delete d._d[b]}}}}},isSameElement:function(d,c){if(d.tagName!=c.tagName){return 0}var h=d.attributes,g=c.attributes;if(!ie&&h.length!=g.length){return 0}var a,j,f=0,b=0;for(var e=0;a=h[e++];){if(a.nodeName=="style"){if(a.specified){f++}if(domUtils.isSameStyle(d,c)){continue}else{return 0}}if(ie){if(a.specified){f++;j=g.getNamedItem(a.nodeName)}else{continue}}else{j=c.attributes[a.nodeName]}if(!j.specified||a.nodeValue!=j.nodeValue){return 0}}if(ie){for(e=0;j=g[e++];){if(j.specified){b++}}if(f!=b){return 0}}return 1},isSameStyle:function(d,c){var b=d.style.cssText.replace(/( ?; ?)/g,";").replace(/( ?: ?)/g,":"),a=c.style.cssText.replace(/( ?; ?)/g,";").replace(/( ?: ?)/g,":");if(browser.opera){b=d.style;a=c.style;if(b.length!=a.length){return 0}for(var g in b){if(/^(\d+|csstext)$/i.test(g)){continue}if(b[g]!=a[g]){return 0}}return 1}if(!b||!a){return b==a?1:0}b=b.split(";");a=a.split(";");if(b.length!=a.length){return 0}for(var f=0,e;e=b[f++];){if(utils.indexOf(a,e)==-1){return 0}}return 1},isBlockElm:function(a){return a.nodeType==1&&(dtd.$block[a.tagName]||styleBlock[domUtils.getComputedStyle(a,"display")])&&!dtd.$nonChild[a.tagName]},isBody:function(a){return a&&a.nodeType==1&&a.tagName.toLowerCase()=="body"},breakParent:function(e,c){var b,g=e,f=e,a,d;do{g=g.parentNode;if(a){b=g.cloneNode(false);b.appendChild(a);a=b;b=g.cloneNode(false);b.appendChild(d);d=b}else{a=g.cloneNode(false);d=a.cloneNode(false)}while(b=f.previousSibling){a.insertBefore(b,a.firstChild)}while(b=f.nextSibling){d.appendChild(b)}f=g}while(c!==g);b=c.parentNode;b.insertBefore(a,c);b.insertBefore(d,c);b.insertBefore(e,d);domUtils.remove(c);return e},isEmptyInlineElement:function(a){if(a.nodeType!=1||!dtd.$removeEmpty[a.tagName]){return 0}a=a.firstChild;while(a){if(domUtils.isBookmarkNode(a)){return 0}if(a.nodeType==1&&!domUtils.isEmptyInlineElement(a)||a.nodeType==3&&!domUtils.isWhitespace(a)){return 0}a=a.nextSibling}return 1},trimWhiteTextNode:function(b){function a(c){var d;while((d=b[c])&&d.nodeType==3&&domUtils.isWhitespace(d)){b.removeChild(d)}}a("firstChild");a("lastChild")},mergChild:function(d,b,k){var g=domUtils.getElementsByTagName(d,d.tagName.toLowerCase());for(var f=0,m;m=g[f++];){if(!m.parentNode||domUtils.isBookmarkNode(m)){continue}if(m.tagName.toLowerCase()=="span"){if(d===m.parentNode){domUtils.trimWhiteTextNode(d);if(d.childNodes.length==1){d.style.cssText=m.style.cssText+";"+d.style.cssText;domUtils.remove(m,true);continue}}m.style.cssText=d.style.cssText+";"+m.style.cssText;if(k){var a=k.style;if(a){a=a.split(";");for(var e=0,l;l=a[e++];){m.style[utils.cssStyleToDomStyle(l.split(":")[0])]=l.split(":")[1]}}}if(domUtils.isSameStyle(m,d)){domUtils.remove(m,true)}continue}if(domUtils.isSameElement(d,m)){domUtils.remove(m,true)}}if(b=="span"){var c=domUtils.getElementsByTagName(d,"a");for(var f=0,h;h=c[f++];){h.style.cssText=";"+d.style.cssText;h.style.textDecoration="underline"}}},getElementsByTagName:function(e,b){var f=e.getElementsByTagName(b),a=[];for(var d=0,c;c=f[d++];){a.push(c)}return a},mergToParent:function(b){var a=b.parentNode;while(a&&dtd.$removeEmpty[a.tagName]){if(a.tagName==b.tagName||a.tagName=="A"){domUtils.trimWhiteTextNode(a);if(a.tagName=="SPAN"&&!domUtils.isSameStyle(a,b)||(a.tagName=="A"&&b.tagName=="SPAN")){if(a.childNodes.length>1||a!==b.parentNode){b.style.cssText=a.style.cssText+";"+b.style.cssText;a=a.parentNode;continue}else{a.style.cssText+=";"+b.style.cssText;if(a.tagName=="A"){a.style.textDecoration="underline"}}}if(a.tagName!="A"){a===b.parentNode&&domUtils.remove(b,true);break}}a=a.parentNode}},mergSibling:function(c,b,a){function d(g,h,f){var e;if((e=f[g])&&!domUtils.isBookmarkNode(e)&&e.nodeType==1&&domUtils.isSameElement(f,e)){while(e.firstChild){if(h=="firstChild"){f.insertBefore(e.lastChild,f.firstChild)}else{f.appendChild(e.firstChild)}}domUtils.remove(e)}}!b&&d("previousSibling","firstChild",c);!a&&d("nextSibling","lastChild",c)},unselectable:ie||browser.opera?function(c){c.onselectstart=function(){return false};c.onclick=c.onkeyup=c.onkeydown=function(){return false};c.unselectable="on";c.setAttribute("unselectable","on");for(var b=0,a;a=c.all[b++];){switch(a.tagName.toLowerCase()){case"iframe":case"textarea":case"input":case"select":break;default:a.unselectable="on";c.setAttribute("unselectable","on")}}}:function(a){a.style.MozUserSelect=a.style.webkitUserSelect=a.style.KhtmlUserSelect="none"},removeAttributes:function(d,c){for(var b=0,a;a=c[b++];){a=attrFix[a]||a;switch(a){case"className":d[a]="";break;case"style":d.style.cssText="";!browser.ie&&d.removeAttributeNode(d.getAttributeNode("style"))}d.removeAttribute(a)}},creElm:function(c,a,b){return this.setAttributes(c.createElement(a),b)},setAttributes:function(c,b){for(var a in b){var d=b[a];switch(a){case"class":c.className=d;break;case"style":c.style.cssText=c.style.cssText+";"+d;break;case"innerHTML":c[a]=d;break;case"value":c.value=d;break;default:c.setAttribute(attrFix[a]||a,d)}}return c},getComputedStyle:function(c,b){function f(e,i){if(e=="font-size"&&/pt$/.test(i)){i=Math.round(parseFloat(i)/0.75)+"px"}return i}if(c.nodeType==3){c=c.parentNode}if(browser.ie&&browser.version<9&&b=="font-size"&&!c.style.fontSize&&!dtd.$empty[c.tagName]&&!dtd.$nonChild[c.tagName]){var d=c.ownerDocument.createElement("span");d.style.cssText="padding:0;border:0;font-family:simsun;";d.innerHTML=".";c.appendChild(d);var a=d.offsetHeight;c.removeChild(d);d=null;return a+"px"}try{var g=domUtils.getStyle(c,b)||(window.getComputedStyle?domUtils.getWindow(c).getComputedStyle(c,"").getPropertyValue(b):(c.currentStyle||c.style)[utils.cssStyleToDomStyle(b)])}catch(h){return null}return f(b,utils.fixColor(b,g))},removeClasses:function(a,b){b=utils.isArray(b)?b:[b];a.className=(" "+a.className+" ").replace(new RegExp("(?:\\s+(?:"+b.join("|")+"))+\\s+","g")," ")},addClass:function(a,b){if(!this.hasClass(a,b)){a.className+=" "+b}},removeStyle:function(b,a){b.style[utils.cssStyleToDomStyle(a)]="";if(!b.style.cssText){domUtils.removeAttributes(b,["style"])}},hasClass:function(a,b){return(" "+a.className+" ").indexOf(" "+b+" ")>-1},preventDefault:function(a){a.preventDefault?a.preventDefault():(a.returnValue=false)},getStyle:function(b,a){var c=b.style[utils.cssStyleToDomStyle(a)];return utils.fixColor(a,c)},setStyle:function(b,a,c){b.style[utils.cssStyleToDomStyle(a)]=c},setStyles:function(b,c){for(var a in c){if(c.hasOwnProperty(a)){domUtils.setStyle(b,a,c[a])}}},removeDirtyAttr:function(d){for(var c=0,b,a=d.getElementsByTagName("*");b=a[c++];){b.removeAttribute("_moz_dirty")}d.removeAttribute("_moz_dirty")},getChildCount:function(c,a){var b=0,d=c.firstChild;a=a||function(){return 1};while(d){if(a(d)){b++}d=d.nextSibling}return b},isEmptyNode:function(a){return !a.firstChild||domUtils.getChildCount(a,function(b){return !domUtils.isBr(b)&&!domUtils.isBookmarkNode(b)&&!domUtils.isWhitespace(b)})==0},clearSelectedArr:function(a){var b;while(b=a.pop()){domUtils.removeAttributes(b,["class"])}},scrollToView:function(c,i,a){var b=function(){var j=i.document,k=j.compatMode=="CSS1Compat";return{width:(k?j.documentElement.clientWidth:j.body.clientWidth)||0,height:(k?j.documentElement.clientHeight:j.body.clientHeight)||0}},h=function(k){if("pageXOffset" in k){return{x:k.pageXOffset||0,y:k.pageYOffset||0}}else{var j=k.document;return{x:j.documentElement.scrollLeft||j.body.scrollLeft||0,y:j.documentElement.scrollTop||j.body.scrollTop||0}}};var f=b().height,g=f*-1+a;g+=(c.offsetHeight||0);var d=domUtils.getXY(c);g+=d.y;var e=h(i).y;if(g>e||g<e-f){i.scrollTo(0,g+(g<0?-20:20))}},isBr:function(a){return a.nodeType==1&&a.tagName=="BR"},isFillChar:function(a){return a.nodeType==3&&!a.nodeValue.replace(new RegExp(domUtils.fillChar),"").length},isStartInblock:function(b){var f=b.cloneRange(),a=0,g=f.startContainer,c;while(g&&domUtils.isFillChar(g)){c=g;g=g.previousSibling}if(c){f.setStartBefore(c);g=f.startContainer}if(g.nodeType==1&&domUtils.isEmptyNode(g)&&f.startOffset==1){f.setStart(g,0).collapse(true)}while(!f.startOffset){g=f.startContainer;if(domUtils.isBlockElm(g)||domUtils.isBody(g)){a=1;break}var e=f.startContainer.previousSibling,d;if(!e){f.setStartBefore(f.startContainer)}else{while(e&&domUtils.isFillChar(e)){d=e;e=e.previousSibling}if(d){f.setStartBefore(d)}else{f.setStartBefore(f.startContainer)}}}return a&&!domUtils.isBody(f.startContainer)?1:0},isEmptyBlock:function(b){var a=new RegExp("[ \t\r\n"+domUtils.fillChar+"]","g");if(b[browser.ie?"innerText":"textContent"].replace(a,"").length>0){return 0}for(var c in dtd.$isNotEmpty){if(b.getElementsByTagName(c).length){return 0}}return 1},setViewportOffset:function(a,g){var f=parseInt(a.style.left)|0;var e=parseInt(a.style.top)|0;var c=a.getBoundingClientRect();var d=g.left-c.left;var b=g.top-c.top;if(d){a.style.left=f+d+"px"}if(b){a.style.top=e+b+"px"}},fillNode:function(c,b){var a=browser.ie?c.createTextNode(domUtils.fillChar):c.createElement("br");b.innerHTML="";b.appendChild(a)},moveChild:function(c,a,b){while(c.firstChild){if(b&&a.firstChild){a.insertBefore(c.lastChild,a.firstChild)}else{a.appendChild(c.firstChild)}}},hasNoAttributes:function(a){return browser.ie?/^<\w+\s*?>/.test(a.outerHTML):a.attributes.length==0},isCustomeNode:function(a){return a.nodeType==1&&a.getAttribute("_ue_custom_node_")},isTagNode:function(b,a){return b.nodeType==1&&b.tagName.toLowerCase()==a}};var fillCharReg=new RegExp(domUtils.fillChar,"g");(function(){var g=0,h=domUtils.fillChar,c;function b(j){j.collapsed=j.startContainer&&j.endContainer&&j.startContainer===j.endContainer&&j.startOffset==j.endOffset}function a(k,l,m,j){if(l.nodeType==1&&(dtd.$empty[l.tagName]||dtd.$nonChild[l.tagName])){m=domUtils.getNodeIndex(l)+(k?0:1);l=l.parentNode}if(k){j.startContainer=l;j.startOffset=m;if(!j.endContainer){j.collapse(true)}}else{j.endContainer=l;j.endOffset=m;if(!j.startContainer){j.collapse(false)}}b(j);return j}function i(r,v){var o=r.startContainer,n=r.endContainer,x=r.startOffset,q=r.endOffset,D=r.document,k=D.createDocumentFragment(),s,u;if(o.nodeType==1){o=o.childNodes[x]||(s=o.appendChild(D.createTextNode("")))}if(n.nodeType==1){n=n.childNodes[q]||(u=n.appendChild(D.createTextNode("")))}if(o===n&&o.nodeType==3){k.appendChild(D.createTextNode(o.substringData(x,q-x)));if(v){o.deleteData(x,q-x);r.collapse(true)}return k}var t,z,B=k,A=domUtils.findParents(o,true),l=domUtils.findParents(n,true);for(var y=0;A[y]==l[y];){y++}for(var w=y,C;C=A[w];w++){t=C.nextSibling;if(C==o){if(!s){if(r.startContainer.nodeType==3){B.appendChild(D.createTextNode(o.nodeValue.slice(x)));if(v){o.deleteData(x,o.nodeValue.length-x)}}else{B.appendChild(!v?o.cloneNode(true):o)}}}else{z=C.cloneNode(false);B.appendChild(z)}while(t){if(t===n||t===l[w]){break}C=t.nextSibling;B.appendChild(!v?t.cloneNode(true):t);t=C}B=z}B=k;if(!A[y]){B.appendChild(A[y-1].cloneNode(false));B=B.firstChild}for(var w=y,m;m=l[w];w++){t=m.previousSibling;if(m==n){if(!u&&r.endContainer.nodeType==3){B.appendChild(D.createTextNode(n.substringData(0,q)));if(v){n.deleteData(0,q)}}}else{z=m.cloneNode(false);B.appendChild(z)}if(w!=y||!A[y]){while(t){if(t===o){break}m=t.previousSibling;B.insertBefore(!v?t.cloneNode(true):t,B.firstChild);t=m}}B=z}if(v){r.setStartBefore(!l[y]?l[y-1]:!A[y]?A[y-1]:l[y]).collapse(true)}s&&domUtils.remove(s);u&&domUtils.remove(u);return k}var d=dom.Range=function(j){var k=this;k.startContainer=k.startOffset=k.endContainer=k.endOffset=null;k.document=j;k.collapsed=true};function f(m,j){try{if(c&&domUtils.inDoc(c,m)){if(!c.nodeValue.replace(fillCharReg,"").length){var k=c.parentNode;domUtils.remove(c);while(k&&domUtils.isEmptyInlineElement(k)&&!k.contains(j)){c=k.parentNode;domUtils.remove(k);k=c}}else{c.nodeValue=c.nodeValue.replace(fillCharReg,"")}}}catch(l){}}function e(l,j){var k;l=l[j];while(l&&domUtils.isFillChar(l)){k=l[j];domUtils.remove(l);l=k}}d.prototype={cloneContents:function(){return this.collapsed?null:i(this,0)},deleteContents:function(){var j;if(!this.collapsed){i(this,1)}if(browser.webkit){j=this.startContainer;if(j.nodeType==3&&!j.nodeValue.length){this.setStartBefore(j).collapse(true);domUtils.remove(j)}}return this},extractContents:function(){return this.collapsed?null:i(this,2)},setStart:function(j,k){return a(true,j,k,this)},setEnd:function(j,k){return a(false,j,k,this)},setStartAfter:function(j){return this.setStart(j.parentNode,domUtils.getNodeIndex(j)+1)},setStartBefore:function(j){return this.setStart(j.parentNode,domUtils.getNodeIndex(j))},setEndAfter:function(j){return this.setEnd(j.parentNode,domUtils.getNodeIndex(j)+1)},setStartAtFirst:function(j){return this.setStart(j,0)},setStartAtLast:function(j){return this.setStart(j,j.nodeType==3?j.nodeValue.length:j.childNodes.length)},setEndAtFirst:function(j){return this.setEnd(j,0)},setEndAtLast:function(j){return this.setEnd(j,j.nodeType==3?j.nodeValue.length:j.childNodes.length)},setEndBefore:function(j){return this.setEnd(j.parentNode,domUtils.getNodeIndex(j))},selectNode:function(j){return this.setStartBefore(j).setEndAfter(j)},selectNodeContents:function(j){return this.setStart(j,0).setEnd(j,j.nodeType==3?j.nodeValue.length:j.childNodes.length)},cloneRange:function(){var k=this,j=new d(k.document);return j.setStart(k.startContainer,k.startOffset).setEnd(k.endContainer,k.endOffset)},collapse:function(j){var k=this;if(j){k.endContainer=k.startContainer;k.endOffset=k.startOffset}else{k.startContainer=k.endContainer;k.startOffset=k.endOffset}k.collapsed=true;return k},shrinkBoundary:function(k){var j=this,m,l=j.collapsed;while(j.startContainer.nodeType==1&&(m=j.startContainer.childNodes[j.startOffset])&&m.nodeType==1&&!domUtils.isBookmarkNode(m)&&!dtd.$empty[m.tagName]&&!dtd.$nonChild[m.tagName]){j.setStart(m,0)}if(l){return j.collapse(true)}if(!k){while(j.endContainer.nodeType==1&&j.endOffset>0&&(m=j.endContainer.childNodes[j.endOffset-1])&&m.nodeType==1&&!domUtils.isBookmarkNode(m)&&!dtd.$empty[m.tagName]&&!dtd.$nonChild[m.tagName]){j.setEnd(m,m.childNodes.length)}}return j},getCommonAncestor:function(k,l){var m=this.startContainer,j=this.endContainer;if(m===j){if(k&&m.nodeType==1&&this.startOffset==this.endOffset-1){return m.childNodes[this.startOffset]}return l&&m.nodeType==3?m.parentNode:m}return domUtils.getCommonAncestor(m,j)},trimBoundary:function(k){this.txtToElmBoundary();var o=this.startContainer,n=this.startOffset,m=this.collapsed,j=this.endContainer;if(o.nodeType==3){if(n==0){this.setStartBefore(o)}else{if(n>=o.nodeValue.length){this.setStartAfter(o)}else{var l=domUtils.split(o,n);if(o===j){this.setEnd(l,this.endOffset-n)}else{if(o.parentNode===j){this.endOffset+=1}}this.setStartBefore(l)}}if(m){return this.collapse(true)}}if(!k){n=this.endOffset;j=this.endContainer;if(j.nodeType==3){if(n==0){this.setEndBefore(j)}else{if(n>=j.nodeValue.length){this.setEndAfter(j)}else{domUtils.split(j,n);this.setEndAfter(j)}}}}return this},txtToElmBoundary:function(){function j(l,n){var k=l[n+"Container"],m=l[n+"Offset"];if(k.nodeType==3){if(!m){l["set"+n.replace(/(\w)/,function(o){return o.toUpperCase()})+"Before"](k)}else{if(m>=k.nodeValue.length){l["set"+n.replace(/(\w)/,function(o){return o.toUpperCase()})+"After"](k)}}}}if(!this.collapsed){j(this,"start");j(this,"end")}return this},insertNode:function(l){var n=l,k=1;if(l.nodeType==11){n=l.firstChild;k=l.childNodes.length}this.trimBoundary(true);var o=this.startContainer,m=this.startOffset;var j=o.childNodes[m];if(j){o.insertBefore(l,j)}else{o.appendChild(l)}if(n.parentNode===this.endContainer){this.endOffset=this.endOffset+k}return this.setStartBefore(n)},setCursor:function(k,j){return this.collapse(!k).select(j)},createBookmark:function(l,m){var j,k=this.document.createElement("span");k.style.cssText="display:none;line-height:0px;";k.appendChild(this.document.createTextNode("\uFEFF"));k.id="_baidu_bookmark_start_"+(m?"":g++);if(!this.collapsed){j=k.cloneNode(true);j.id="_baidu_bookmark_end_"+(m?"":g++)}this.insertNode(k);if(j){this.collapse(false).insertNode(j);this.setEndBefore(j)}this.setStartAfter(k);return{start:l?k.id:k,end:j?l?j.id:j:null,id:l}},moveToBookmark:function(k){var l=k.id?this.document.getElementById(k.start):k.start,j=k.end&&k.id?this.document.getElementById(k.end):k.end;this.setStartBefore(l);domUtils.remove(l);if(j){this.setEndBefore(j);domUtils.remove(j)}else{this.collapse(true)}return this},enlarge:function(k,n){var j=domUtils.isBody,o,m,l=this.document.createTextNode("");if(k){m=this.startContainer;if(m.nodeType==1){if(m.childNodes[this.startOffset]){o=m=m.childNodes[this.startOffset]}else{m.appendChild(l);o=m=l}}else{o=m}while(1){if(domUtils.isBlockElm(m)){m=o;while((o=m.previousSibling)&&!domUtils.isBlockElm(o)){m=o}this.setStartBefore(m);break}o=m;m=m.parentNode}m=this.endContainer;if(m.nodeType==1){if(o=m.childNodes[this.endOffset]){m.insertBefore(l,o)}else{m.appendChild(l)}o=m=l}else{o=m}while(1){if(domUtils.isBlockElm(m)){m=o;while((o=m.nextSibling)&&!domUtils.isBlockElm(o)){m=o}this.setEndAfter(m);break}o=m;m=m.parentNode}if(l.parentNode===this.endContainer){this.endOffset--}domUtils.remove(l)}if(!this.collapsed){while(this.startOffset==0){if(n&&n(this.startContainer)){break}if(j(this.startContainer)){break}this.setStartBefore(this.startContainer)}while(this.endOffset==(this.endContainer.nodeType==1?this.endContainer.childNodes.length:this.endContainer.nodeValue.length)){if(n&&n(this.endContainer)){break}if(j(this.endContainer)){break}this.setEndAfter(this.endContainer)}}return this},adjustmentBoundary:function(){if(!this.collapsed){while(!domUtils.isBody(this.startContainer)&&this.startOffset==this.startContainer[this.startContainer.nodeType==3?"nodeValue":"childNodes"].length){this.setStartAfter(this.startContainer)}while(!domUtils.isBody(this.endContainer)&&!this.endOffset){this.setEndBefore(this.endContainer)}}return this},applyInlineStyle:function(l,x,t){if(this.collapsed){return this}this.trimBoundary().enlarge(false,function(B){return B.nodeType==1&&domUtils.isBlockElm(B)}).adjustmentBoundary();var u=this.createBookmark(),o=u.end,z=function(B){return B.nodeType==1?B.tagName.toLowerCase()!="br":!domUtils.isWhitespace(B)},s=domUtils.getNextDomNode(u.start,false,z),m,n,r=this.cloneRange();while(s&&(domUtils.getPosition(s,o)&domUtils.POSITION_PRECEDING)){if(s.nodeType==3||dtd[l][s.tagName]){r.setStartBefore(s);m=s;while(m&&(m.nodeType==3||dtd[l][m.tagName])&&m!==o){n=m;m=domUtils.getNextDomNode(m,m.nodeType==1,null,function(B){return dtd[l][B.tagName]})}var y=r.setEndAfter(n).extractContents(),v;if(t&&t.length>0){var j,w;w=j=t[0].cloneNode(false);for(var q=1,A;A=t[q++];){j.appendChild(A.cloneNode(false));j=j.firstChild}v=j}else{v=r.document.createElement(l)}if(x){domUtils.setAttributes(v,x)}v.appendChild(y);r.insertNode(t?w:v);var k;if(l=="span"&&x.style&&/text\-decoration/.test(x.style)&&(k=domUtils.findParentByTagName(v,"a",true))){domUtils.setAttributes(k,x);domUtils.remove(v,true);v=k}else{domUtils.mergSibling(v);domUtils.clearEmptySibling(v)}domUtils.mergChild(v,l,x);s=domUtils.getNextDomNode(v,false,z);domUtils.mergToParent(v);if(m===o){break}}else{s=domUtils.getNextDomNode(s,true,z)}}return this.moveToBookmark(u)},removeInlineStyle:function(k){if(this.collapsed){return this}k=utils.isArray(k)?k:[k];this.shrinkBoundary().adjustmentBoundary();var r=this.startContainer,j=this.endContainer;while(1){if(r.nodeType==1){if(utils.indexOf(k,r.tagName.toLowerCase())>-1){break}if(r.tagName.toLowerCase()=="body"){r=null;break}}r=r.parentNode}while(1){if(j.nodeType==1){if(utils.indexOf(k,j.tagName.toLowerCase())>-1){break}if(j.tagName.toLowerCase()=="body"){j=null;break}}j=j.parentNode}var m=this.createBookmark(),q,o;if(r){o=this.cloneRange().setEndBefore(m.start).setStartBefore(r);q=o.extractContents();o.insertNode(q);domUtils.clearEmptySibling(r,true);r.parentNode.insertBefore(m.start,r)}if(j){o=this.cloneRange().setStartAfter(m.end).setEndAfter(j);q=o.extractContents();o.insertNode(q);domUtils.clearEmptySibling(j,false,true);j.parentNode.insertBefore(m.end,j.nextSibling)}var n=domUtils.getNextDomNode(m.start,false,function(s){return s.nodeType==1}),l;while(n&&n!==m.end){l=domUtils.getNextDomNode(n,true,function(s){return s.nodeType==1});if(utils.indexOf(k,n.tagName.toLowerCase())>-1){domUtils.remove(n,true)}n=l}return this.moveToBookmark(m)},getClosedNode:function(){var k;if(!this.collapsed){var j=this.cloneRange().adjustmentBoundary().shrinkBoundary();if(j.startContainer.nodeType==1&&j.startContainer===j.endContainer&&j.endOffset-j.startOffset==1){var l=j.startContainer.childNodes[j.startOffset];if(l&&l.nodeType==1&&(dtd.$empty[l.tagName]||dtd.$nonChild[l.tagName])){k=l}}}return k},select:browser.ie?function(j,u){var q;if(!this.collapsed){this.shrinkBoundary()}var l=this.getClosedNode();if(l&&!u){try{q=this.document.body.createControlRange();q.addElement(l);q.select()}catch(r){}return this}var s=this.createBookmark(),k=s.start,m;q=this.document.body.createTextRange();q.moveToElementText(k);q.moveStart("character",1);if(!this.collapsed){var o=this.document.body.createTextRange();m=s.end;o.moveToElementText(m);q.setEndPoint("EndToEnd",o)}else{if(!j&&this.startContainer.nodeType!=3){var t=this.document.createTextNode(h),n=this.document.createElement("span");n.appendChild(this.document.createTextNode(h));k.parentNode.insertBefore(n,k);k.parentNode.insertBefore(t,k);f(this.document,t);c=t;e(n,"previousSibling");e(k,"nextSibling");q.moveStart("character",-1);q.collapse(true)}}this.moveToBookmark(s);n&&domUtils.remove(n);try{q.select()}catch(r){}return this}:function(j){var o=domUtils.getWindow(this.document),n=o.getSelection(),m;browser.gecko?this.document.body.focus():o.focus();if(n){n.removeAllRanges();if(this.collapsed){if(j&&browser.opera&&!domUtils.isBody(this.startContainer)&&this.startContainer.nodeType==1){var k=this.document.createTextNode("");this.insertNode(k).setStart(k,0).collapse(true)}if(!j){m=this.document.createTextNode(h);this.insertNode(m);f(this.document,m);e(m,"previousSibling");e(m,"nextSibling");c=m;this.setStart(m,browser.webkit?1:0).collapse(true)}}var l=this.document.createRange();l.setStart(this.startContainer,this.startOffset);l.setEnd(this.endContainer,this.endOffset);n.addRange(l)}return this},scrollToView:function(l,m){l=l?window:domUtils.getWindow(this.document);var j=this.document.createElement("span");j.innerHTML="&nbsp;";var k=this.cloneRange();k.insertNode(j);domUtils.scrollToView(j,l,m);domUtils.remove(j);return this}}})();(function(){function d(q,g){var h=domUtils.getNodeIndex;q=q.duplicate();q.collapse(g);var u=q.parentElement();if(!u.hasChildNodes()){return{container:u,offset:0}}var t=u.children,j,l=q.duplicate(),v=0,o=t.length-1,r=-1,f;while(v<=o){r=Math.floor((v+o)/2);j=t[r];l.moveToElementText(j);var n=l.compareEndPoints("StartToStart",q);if(n>0){o=r-1}else{if(n<0){v=r+1}else{return{container:u,offset:h(j)}}}}if(r==-1){l.moveToElementText(u);l.setEndPoint("StartToStart",q);f=l.text.replace(/(\r\n|\r)/g,"\n").length;t=u.childNodes;if(!f){j=t[t.length-1];return{container:j,offset:j.nodeValue.length}}var m=t.length;while(f>0){f-=t[--m].nodeValue.length}return{container:t[m],offset:-f}}l.collapse(n>0);l.setEndPoint(n>0?"StartToStart":"EndToStart",q);f=l.text.replace(/(\r\n|\r)/g,"\n").length;if(!f){return dtd.$empty[j.tagName]||dtd.$nonChild[j.tagName]?{container:u,offset:h(j)+(n>0?0:1)}:{container:j,offset:n>0?0:j.childNodes.length}}while(f>0){try{var k=j;j=j[n>0?"previousSibling":"nextSibling"];f-=j.nodeValue.length}catch(s){return{container:u,offset:h(k)}}}return{container:j,offset:n>0?-f:j.nodeValue.length+f}}function c(g,f){if(g.item){f.selectNode(g.item(0))}else{var e=d(g,true);f.setStart(e.container,e.offset);if(g.compareEndPoints("StartToEnd",g)!=0){e=d(g,false);f.setEnd(e.container,e.offset)}}return f}function b(h){var g;try{g=h.getNative().createRange()}catch(i){return null}var f=g.item?g.item(0):g.parentElement();if((f.ownerDocument||f)===h.document){return g}return null}var a=dom.Selection=function(g){var f=this,e;f.document=g;if(ie){e=domUtils.getWindow(g).frameElement;domUtils.on(e,"beforedeactivate",function(){f._bakIERange=f.getIERange()});domUtils.on(e,"activate",function(){try{if(!b(f)&&f._bakIERange){f._bakIERange.select()}}catch(h){}f._bakIERange=null})}e=g=null};a.prototype={getNative:function(){var g=this.document;try{return !g?null:ie?g.selection:domUtils.getWindow(g).getSelection()}catch(f){return null}},getIERange:function(){var e=b(this);if(!e){if(this._bakIERange){return this._bakIERange}}return e},cache:function(){this.clear();this._cachedRange=this.getRange();this._cachedStartElement=this.getStart();this._cachedStartElementPath=this.getStartElementPath()},getStartElementPath:function(){if(this._cachedStartElementPath){return this._cachedStartElementPath}var e=this.getStart();if(e){return domUtils.findParents(e,true,null,true)}return[]},clear:function(){this._cachedStartElementPath=this._cachedRange=this._cachedStartElement=null},isFocus:function(){try{return browser.ie&&b(this)||!browser.ie&&this.getNative().rangeCount?true:false}catch(f){return false}},getRange:function(){var h=this;function g(l){var n=h.document.body.firstChild,m=l.collapsed;while(n&&n.firstChild){l.setStart(n,0);n=n.firstChild}if(!l.startContainer){l.setStart(h.document.body,0)}if(m){l.collapse(true)}}if(h._cachedRange!=null){return this._cachedRange}var f=new baidu.editor.dom.Range(h.document);if(ie){var j=h.getIERange();if(j){c(j,f)}else{g(f)}}else{var i=h.getNative();if(i&&i.rangeCount){var e=i.getRangeAt(0);var k=i.getRangeAt(i.rangeCount-1);f.setStart(e.startContainer,e.startOffset).setEnd(k.endContainer,k.endOffset);if(f.collapsed&&domUtils.isBody(f.startContainer)&&!f.startOffset){g(f)}}else{if(this._bakRange&&domUtils.inDoc(this._bakRange.startContainer,this.document)){return this._bakRange}g(f)}}return this._bakRange=f},getStart:function(){if(this._cachedStartElement){return this._cachedStartElement}var e=ie?this.getIERange():this.getRange(),h,i,f,g;if(ie){if(!e){return this.document.body.firstChild}if(e.item){return e.item(0)}h=e.duplicate();h.text.length>0&&h.moveStart("character",1);h.collapse(1);i=h.parentElement();g=f=e.parentElement();while(f=f.parentNode){if(f==i){i=g;break}}}else{e.shrinkBoundary();i=e.startContainer;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[Math.min(i.childNodes.length-1,e.startOffset)]}if(i.nodeType==3){return i.parentNode}}return i},getText:function(){var e,f;if(this.isFocus()&&(e=this.getNative())){f=browser.ie?e.createRange():e.getRangeAt(0);return browser.ie?f.text:f.toString()}return""}}})();(function(){var d=0,b;function c(m){var l=m.getElementsByTagName("img"),k;for(var j=0,h;h=l[j++];){if(k=h.getAttribute("orgSrc")){h.src=k;h.removeAttribute("orgSrc")}}var g=m.getElementsByTagName("a");for(var j=0,f;f=g[j++];j++){if(f.getAttribute("data_ue_src")){f.setAttribute("href",f.getAttribute("data_ue_src"))}}}function e(l,k){var f;if(k.textarea){if(utils.isString(k.textarea)){for(var h=0,j,g=domUtils.getElementsByTagName(l,"textarea");j=g[h++];){if(j.id=="ueditor_textarea_"+k.options.textarea){f=j;break}}}else{f=k.textarea}}if(!f){l.appendChild(f=domUtils.creElm(document,"textarea",{name:k.options.textarea,id:"ueditor_textarea_"+k.options.textarea,style:"display:none"}))}f.value=k.options.allHtmlEnabled?k.getAllHtml():k.getContent(null,null,true)}var a=UE.Editor=function(f){var g=this;g.uid=d++;EventBase.call(g);g.commands={};g.options=utils.extend(f||{},UEDITOR_CONFIG,true);g.setOpt({isShow:true,initialContent:"\u6b22\u8fce\u4f7f\u7528ueditor!",autoClearinitialContent:false,iframeCssUrl:g.options.UEDITOR_HOME_URL+"/themes/default/iframe.css",textarea:"editorValue",focus:false,minFrameHeight:320,autoClearEmptyNode:true,fullscreen:false,readonly:false,zIndex:999,imagePopup:true,enterTag:"p",pageBreakTag:"_baidu_page_break_tag_",customDomain:false,lang:"zh-cn",langPath:g.options.UEDITOR_HOME_URL+"lang/",allHtmlEnabled:false});utils.loadFile(document,{src:g.options.langPath+g.options.lang+"/"+g.options.lang+".js",tag:"script",type:"text/javascript",defer:"defer"},function(){for(var h in UE.plugins){UE.plugins[h].call(g)}g.langIsReady=true;g.fireEvent("langReady")});UE.instants["ueditorInstant"+g.uid]=g};a.prototype={ready:function(f){var g=this;if(f){g.isReady?f.apply(g):g.addListener("ready",f)}},setOpt:function(f,h){var g={};if(utils.isString(f)){g[f]=h}else{g=f}utils.extend(this.options,g,true)},destroy:function(){var f=this;f.fireEvent("destroy");f.container.innerHTML="";domUtils.remove(f.container);for(var g in f){if(f.hasOwnProperty(g)){delete this[g]}}},render:function(g){var j=this,h=j.options;if(g.constructor===String){g=document.getElementById(g)}if(g){var f=ie&&browser.version<9,i=(ie&&browser.version<9?"":"<!DOCTYPE html>")+"<html xmlns='http://www.w3.org/1999/xhtml'"+(!f?" class='view'":"")+"><head>"+(h.iframeCssUrl?"<link rel='stylesheet' type='text/css' href='"+utils.unhtml(h.iframeCssUrl)+"'/>":"")+"<style type='text/css'>.selectTdClass{background-color:#3399FF !important;}table.noBorderTable td{border:1px dashed #ddd !important}table{clear:both;margin-bottom:10px;border-collapse:collapse;word-break:break-all;}.pagebreak{display:block;clear:both !important;cursor:default !important;width: 100% !important;margin:0;}.anchorclass{background: url('"+j.options.UEDITOR_HOME_URL+"themes/default/images/anchor.gif') no-repeat scroll left center transparent;border: 1px dotted #0000FF;cursor: auto;display: inline-block;height: 16px;width: 15px;}.view{padding:0;word-wrap:break-word;cursor:text;height:100%;}\nbody{margin:8px;font-family:'\u5b8b\u4f53';font-size:16px;}li{clear:both}p{margin:5px 0;}"+(h.initialStyle||"")+"</style></head><body"+(f?" class='view'":"")+"></body>";if(h.customDomain&&document.domain!=location.hostname){i+="<script>window.parent.UE.instants['ueditorInstant"+j.uid+"']._setup(document);<\/script></html>";g.appendChild(domUtils.creElm(document,"iframe",{id:"baidu_editor_"+j.uid,width:"100%",height:"100%",frameborder:"0",src:'javascript:void(function(){document.open();document.domain="'+document.domain+'";document.write("'+i+'");document.close();}())'}))}else{g.innerHTML='<iframe id="baidu_editor_'+this.uid+'"width="100%" height="100%" scroll="no" frameborder="0" ></iframe>';var k=g.firstChild.contentWindow.document;!browser.webkit&&k.open();k.write(i+"</html>");!browser.webkit&&k.close();j._setup(k)}g.style.overflow="hidden"}},_setup:function(j){var i=this,f=i.options;if(ie){j.body.disabled=true;j.body.contentEditable=true;j.body.disabled=false}else{j.body.contentEditable=true;j.body.spellcheck=false}i.document=j;i.window=j.defaultView||j.parentWindow;i.iframe=i.window.frameElement;i.body=j.body;i.setHeight(f.minFrameHeight);i.selection=new dom.Selection(j);var k;if(browser.gecko&&(k=this.selection.getNative())){k.removeAllRanges()}this._initEvents();if(f.initialContent){if(f.autoClearinitialContent){var g=i.execCommand;i.execCommand=function(){i.fireEvent("firstBeforeExecCommand");g.apply(i,arguments)};this.setDefaultContent(f.initialContent)}else{this.setContent(f.initialContent,true)}}for(var h=this.iframe.parentNode;!domUtils.isBody(h);h=h.parentNode){if(h.tagName=="FORM"){domUtils.on(h,"submit",function(){e(this,i)});break}}if(domUtils.isEmptyNode(i.body)){i.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>"}if(f.focus){setTimeout(function(){i.focus();!i.options.autoClearinitialContent&&i._selectionChange()})}if(!i.container){i.container=this.iframe.parentNode}if(f.fullscreen&&i.ui){i.ui.setFullScreen(true)}i.isReady=1;i.fireEvent("ready");if(!browser.ie){domUtils.on(i.window,["blur","focus"],function(l){if(l.type=="blur"){i._bakRange=i.selection.getRange();try{i.selection.getNative().removeAllRanges()}catch(l){}}else{try{i._bakRange&&i._bakRange.select()}catch(l){}}})}if(browser.gecko&&browser.version<=10902){i.body.contentEditable=false;setTimeout(function(){i.body.contentEditable=true},100);setInterval(function(){i.body.style.height=i.iframe.offsetHeight-20+"px"},100)}!f.isShow&&i.setHide();f.readonly&&i.setDisabled()},sync:function(h){var g=this,f=h?document.getElementById(h):domUtils.findParent(g.iframe.parentNode,function(i){return i.tagName=="FORM"},true);f&&e(f,g)},setHeight:function(f){if(f!==parseInt(this.iframe.parentNode.style.height)){this.iframe.parentNode.style.height=f+"px"}this.document.body.style.height=f-20+"px"},getContent:function(l,i,f){var k=this;if(l&&utils.isFunction(l)){i=l;l=""}if(i?!i():!this.hasContents()){return""}k.fireEvent("beforegetcontent",l);var h=new RegExp(domUtils.fillChar,"g"),g=k.body.innerHTML.replace(h,"").replace(/>[\t\r\n]*?</g,"><");k.fireEvent("aftergetcontent",l);if(k.serialize){var j=k.serialize.parseHTML(g);j=k.serialize.transformOutput(j);g=k.serialize.toHTML(j)}if(ie&&f){g=g.replace(/<p>\s*?<\/p>/g,"<p>&nbsp;</p>")}else{g=g.replace(/(&nbsp;)+/g,function(o){for(var n=0,q=[],m=o.split(";").length-1;n<m;n++){q.push(n%2==0?" ":"&nbsp;")}return q.join("")})}return g},getAllHtml:function(){var h=this,g={html:""},f="";h.fireEvent("getAllHtml",g);return"<html><head>"+(h.options.charset?'<meta http-equiv="Content-Type" content="text/html; charset='+h.options.charset+'"/>':"")+h.document.getElementsByTagName("head")[0].innerHTML+g.html+"</head><body "+(ie&&browser.version<9?'class="view"':"")+">"+h.getContent(null,null,true)+"</body></html>"},getPlainTxt:function(){var g=new RegExp(domUtils.fillChar,"g"),f=this.body.innerHTML.replace(/[\n\r]/g,"");f=f.replace(/<(p|div)[^>]*>(<br\/?>|&nbsp;)<\/\1>/gi,"\n").replace(/<br\/?>/gi,"\n").replace(/<[^>/]+>/g,"").replace(/(\n)?<\/([^>]+)>/g,function(i,h,j){return dtd.$block[j]?"\n":h?h:""});return f.replace(g,"").replace(/\u00a0/g," ").replace(/&nbsp;/g," ")},getContentTxt:function(){var f=new RegExp(domUtils.fillChar,"g");return this.body[browser.ie?"innerText":"textContent"].replace(f,"").replace(/\u00a0/g," ")},setContent:function(l,j){var o=this,n=utils.extend({a:1,A:1},dtd.$inline,true),k;l=l.replace(/^[ \t\r\n]*?</,"<").replace(/>[ \t\r\n]*?$/,">").replace(/>[\t\r\n]*?</g,"><").replace(/[\s\/]?(\w+)?>[ \t\r\n]*?<\/?(\w+)/gi,function(s,r,t){if(r){k=t}else{r=k}return !n[r]&&!n[t]?s.replace(/>[ \t\r\n]*?</,"><"):s});o.fireEvent("beforesetcontent");var q=this.serialize;if(q){var i=q.parseHTML(l);i=q.transformInput(i);i=q.filter(i);l=q.toHTML(i)}this.body.innerHTML=l.replace(new RegExp("[\r"+domUtils.fillChar+"]*","g"),"");if(browser.ie&&browser.version<7){c(this.document.body)}if(o.options.enterTag=="p"){var g=this.body.firstChild,h;if(!g||g.nodeType==1&&(dtd.$cdata[g.tagName]||domUtils.isCustomeNode(g))&&g===this.body.lastChild){this.body.innerHTML="<p>"+(browser.ie?"&nbsp;":"<br/>")+"</p>"+this.body.innerHTML}else{var f=o.document.createElement("p");while(g){while(g&&(g.nodeType==3||g.nodeType==1&&dtd.p[g.tagName]&&!dtd.$cdata[g.tagName])){h=g.nextSibling;f.appendChild(g);g=h}if(f.firstChild){if(!g){o.body.appendChild(f);break}else{o.body.insertBefore(f,g);f=o.document.createElement("p")}}g=g.nextSibling}}}o.adjustTable&&o.adjustTable(o.body);o.fireEvent("aftersetcontent");o.fireEvent("contentchange");!j&&o._selectionChange();o._bakRange=o._bakIERange=null;var m;if(browser.gecko&&(m=this.selection.getNative())){m.removeAllRanges()}},focus:function(i){try{var g=this,f=g.selection.getRange();if(i){f.setStartAtLast(g.body.lastChild).setCursor(false,true)}else{f.select(true)}}catch(h){}},_initEvents:function(){var g=this,k=g.document,j=g.window;g._proxyDomEvent=utils.bind(g._proxyDomEvent,g);domUtils.on(k,["click","contextmenu","mousedown","keydown","keyup","keypress","mouseup","mouseover","mouseout","selectstart"],g._proxyDomEvent);domUtils.on(j,["focus","blur"],g._proxyDomEvent);domUtils.on(k,["mouseup","keydown"],function(l){if(l.type=="keydown"&&(l.ctrlKey||l.metaKey||l.shiftKey||l.altKey)){return}if(l.button==2){return}g._selectionChange(250,l)});var f=0,h=browser.ie?g.body:g.document,i;domUtils.on(h,"dragstart",function(){f=1});domUtils.on(h,browser.webkit?"dragover":"drop",function(){return browser.webkit?function(){clearTimeout(i);i=setTimeout(function(){if(!f){var q=g.selection,l=q.getRange();if(l){var m=l.getCommonAncestor();if(m&&g.serialize){var o=g.serialize,n=o.filter(o.transformInput(o.parseHTML(o.word(m.innerHTML))));m.innerHTML=o.toHTML(n)}}}f=0},200)}:function(l){if(!f){l.preventDefault?l.preventDefault():(l.returnValue=false)}f=0}}())},_proxyDomEvent:function(f){return this.fireEvent(f.type.replace(/^on/,""),f)},_selectionChange:function(i,f){var l=this;var k=false;var j,h;if(browser.ie&&browser.version<9&&f&&f.type=="mouseup"){var g=this.selection.getRange();if(!g.collapsed){k=true;j=f.clientX;h=f.clientY}}clearTimeout(b);b=setTimeout(function(){if(!l.selection.getNative()){return}var n;if(k&&l.selection.getNative().type=="None"){n=l.document.body.createTextRange();try{n.moveToPoint(j,h)}catch(m){n=null}}var o;if(n){o=l.selection.getIERange;l.selection.getIERange=function(){return n}}l.selection.cache();if(o){l.selection.getIERange=o}if(l.selection._cachedRange&&l.selection._cachedStartElement){l.fireEvent("beforeselectionchange");l.fireEvent("selectionchange",!!f);l.fireEvent("afterselectionchange");l.selection.clear()}},i||50)},_callCmdFn:function(j,g){var f=g[0].toLowerCase(),i,h;i=this.commands[f]||UE.commands[f];h=i&&i[j];if((!i||!h)&&j=="queryCommandState"){return 0}else{if(h){return h.apply(this,g)}}},execCommand:function(g){g=g.toLowerCase();var h=this,f,i=h.commands[g]||UE.commands[g];if(!i||!i.execCommand){return}if(!i.notNeedUndo&&!h.__hasEnterExecCommand){h.__hasEnterExecCommand=true;if(h.queryCommandState(g)!=-1){h.fireEvent("beforeexeccommand",g);f=this._callCmdFn("execCommand",arguments);h.fireEvent("afterexeccommand",g)}h.__hasEnterExecCommand=false}else{f=this._callCmdFn("execCommand",arguments)}h._selectionChange();return f},queryCommandState:function(f){return this._callCmdFn("queryCommandState",arguments)},queryCommandValue:function(f){return this._callCmdFn("queryCommandValue",arguments)},hasContents:function(g){if(g){for(var j=0,h;h=g[j++];){if(this.document.getElementsByTagName(h).length>0){return true}}}if(!domUtils.isEmptyBlock(this.body)){return true}g=["div"];for(j=0;h=g[j++];){var f=domUtils.getElementsByTagName(this.document,h);for(var l=0,k;k=f[l++];){if(domUtils.isCustomeNode(k)){return true}}}return false},reset:function(){this.fireEvent("reset")},setEnabled:function(){var g=this,f;if(g.body.contentEditable=="false"){g.body.contentEditable=true;f=g.selection.getRange();try{f.moveToBookmark(g.lastBk);delete g.lastBk}catch(h){f.setStartAtFirst(g.body).collapse(true)}f.select(true);if(g.bkqueryCommandState){g.queryCommandState=g.bkqueryCommandState;delete g.bkqueryCommandState}g.fireEvent("selectionchange")}},setDisabled:function(f){var g=this;f=f?utils.isArray(f)?f:[f]:[];if(g.body.contentEditable=="true"){if(!g.lastBk){g.lastBk=g.selection.getRange().createBookmark(true)}g.body.contentEditable=false;g.bkqueryCommandState=g.queryCommandState;g.queryCommandState=function(h){if(utils.indexOf(f,h)!=-1){return g.bkqueryCommandState.apply(g,arguments)}return -1};g.fireEvent("selectionchange")}},setDefaultContent:function(){function f(){var h=this;if(h.document.getElementById("initContent")){h.document.body.innerHTML="<p>"+(ie?"":"<br/>")+"</p>";var g=h.selection.getRange();h.removeListener("firstBeforeExecCommand",f);h.removeListener("focus",f);setTimeout(function(){g.setStart(h.document.body.firstChild,0).collapse(true).select(true);h._selectionChange()})}}return function(g){var h=this;h.document.body.innerHTML='<p id="initContent">'+g+"</p>";if(browser.ie&&browser.version<7){c(h.document.body)}h.addListener("firstBeforeExecCommand",f);h.addListener("focus",f)}}(),setShow:function(){var g=this,f=g.selection.getRange();if(g.container.style.display=="none"){try{f.moveToBookmark(g.lastBk);delete g.lastBk}catch(h){f.setStartAtFirst(g.body).collapse(true)}f.select(true);g.container.style.display=""}},setHide:function(){var f=this;if(!f.lastBk){f.lastBk=f.selection.getRange().createBookmark(true)}f.container.style.display="none"},getLang:function(h){var j=UE.I18N[this.options.lang];h=(h||"").split(".");for(var g=0,f;f=h[g++];){j=j[f];if(!j){break}}return j}};utils.inherits(a,EventBase)})();UE.ajax=function(){return{request:function(d,f){var j=b(),g=false,e={method:"POST",timeout:5000,async:true,data:{},onsuccess:function(){},onerror:function(){}};if(typeof d==="object"){f=d;d=f.url}if(!j||!d){return}var i=f?utils.extend(e,f):e;var l=a(i);if(!utils.isEmptyObject(i.data)){l+=(l?"&":"")+a(i.data)}var k=setTimeout(function(){if(j.readyState!=4){g=true;j.abort();clearTimeout(k)}},i.timeout);var c=i.method.toUpperCase();var h=d+(d.indexOf("?")==-1?"?":"&")+(c=="POST"?"":l+"&noCache="+ +new Date);j.open(c,h,i.async);j.onreadystatechange=function(){if(j.readyState==4){if(!g&&j.status==200){i.onsuccess(j)}else{i.onerror(j)}}};if(c=="POST"){j.setRequestHeader("Content-Type","application/x-www-form-urlencoded");j.send(l)}else{j.send(null)}}};function a(d){var e=[];for(var c in d){if(c=="method"||c=="timeout"||c=="async"){continue}if(!((typeof d[c]).toLowerCase()=="function"||(typeof d[c]).toLowerCase()=="object")){e.push(encodeURIComponent(c)+"="+encodeURIComponent(d[c]))}}return e.join("&")}function b(){var c=null;if(window.XMLHttpRequest){c=new XMLHttpRequest()}else{try{c=new ActiveXObject("Msxml2.XMLHTTP")}catch(d){try{c=new ActiveXObject("Microsoft.XMLHTTP")}catch(d){}}}return c}}();var baidu=baidu||{};baidu.editor=baidu.editor||{};baidu.editor.ui={};(function(){var d=baidu.editor.browser,c=baidu.editor.dom.domUtils;var g="$EDITORUI";var f=window[g]={};var a="ID"+g;var i=0;var b=baidu.editor.ui.uiUtils={uid:function(j){return(j?j[a]||(j[a]=++i):++i)},hook:function(j,l){var k;if(j&&j._callbacks){k=j}else{k=function(){var s;if(j){s=j.apply(this,arguments)}var o=k._callbacks;var m=o.length;while(m--){var n=o[m].apply(this,arguments);if(s===undefined){s=n}}return s};k._callbacks=[]}k._callbacks.push(l);return k},createElementByHtml:function(j){var k=document.createElement("div");k.innerHTML=j;k=k.firstChild;k.parentNode.removeChild(k);return k},getViewportElement:function(){return(d.ie&&d.quirks)?document.body:document.documentElement},getClientRect:function(j){var n;try{n=j.getBoundingClientRect()}catch(m){n={left:0,top:0,height:0,width:0}}var k={left:Math.round(n.left),top:Math.round(n.top),height:Math.round(n.bottom-n.top),width:Math.round(n.right-n.left)};var l;while((l=j.ownerDocument)!==document&&(j=c.getWindow(l).frameElement)){n=j.getBoundingClientRect();k.left+=n.left;k.top+=n.top}k.bottom=k.top+k.height;k.right=k.left+k.width;return k},getViewportRect:function(){var k=b.getViewportElement();var l=(window.innerWidth||k.clientWidth)|0;var j=(window.innerHeight||k.clientHeight)|0;return{left:0,top:0,height:j,width:l,bottom:j,right:l}},setViewportOffset:function(j,m){var k;var l=b.getFixedLayer();if(j.parentNode===l){j.style.left=m.left+"px";j.style.top=m.top+"px"}else{c.setViewportOffset(j,m)}},getEventOffset:function(j){var k=j.target||j.srcElement;var l=b.getClientRect(k);var m=b.getViewportOffsetByEvent(j);return{left:m.left-l.left,top:m.top-l.top}},getViewportOffsetByEvent:function(k){var l=k.target||k.srcElement;var j=c.getWindow(l).frameElement;var n={left:k.clientX,top:k.clientY};if(j&&l.ownerDocument!==document){var m=b.getClientRect(j);n.left+=m.left;n.top+=m.top}return n},setGlobal:function(k,j){f[k]=j;return g+'["'+k+'"]'},unsetGlobal:function(j){delete f[j]},copyAttributes:function(o,n){var l=n.attributes;var j=l.length;while(j--){var m=l[j];if(m.nodeName!="style"&&m.nodeName!="class"&&(!d.ie||m.specified)){o.setAttribute(m.nodeName,m.nodeValue)}}if(n.className){o.className+=" "+n.className}if(n.style.cssText){o.style.cssText+=";"+n.style.cssText}},removeStyle:function(k,j){if(k.style.removeProperty){k.style.removeProperty(j)}else{if(k.style.removeAttribute){k.style.removeAttribute(j)}else{throw""}}},contains:function(k,j){return k&&j&&(k===j?false:(k.contains?k.contains(j):k.compareDocumentPosition(j)&16))},startDrag:function(s,n,q){var q=q||document;var m=s.clientX;var l=s.clientY;function k(u){var t=u.clientX-m;var v=u.clientY-l;n.ondragmove(t,v);if(u.stopPropagation){u.stopPropagation()}else{u.cancelBubble=true}}if(q.addEventListener){function r(t){q.removeEventListener("mousemove",k,true);q.removeEventListener("mouseup",k,true);window.removeEventListener("mouseup",r,true);n.ondragstop()}q.addEventListener("mousemove",k,true);q.addEventListener("mouseup",r,true);window.addEventListener("mouseup",r,true);s.preventDefault()}else{var o=s.srcElement;o.setCapture();function j(){o.releaseCapture();o.detachEvent("onmousemove",k);o.detachEvent("onmouseup",j);o.detachEvent("onlosecaptrue",j);n.ondragstop()}o.attachEvent("onmousemove",k);o.attachEvent("onmouseup",j);o.attachEvent("onlosecaptrue",j);s.returnValue=false}n.ondragstart()},getFixedLayer:function(){var j=document.getElementById("edui_fixedlayer");if(j==null){j=document.createElement("div");j.id="edui_fixedlayer";document.body.appendChild(j);if(d.ie&&d.version<=8){j.style.position="absolute";h();setTimeout(e)}else{j.style.position="fixed"}j.style.left="0";j.style.top="0";j.style.width="0";j.style.height="0"}return j},makeUnselectable:function(k){if(d.opera||(d.ie&&d.version<9)){k.unselectable="on";if(k.hasChildNodes()){for(var j=0;j<k.childNodes.length;j++){if(k.childNodes[j].nodeType==1){b.makeUnselectable(k.childNodes[j])}}}}else{if(k.style.MozUserSelect!==undefined){k.style.MozUserSelect="none"}else{if(k.style.WebkitUserSelect!==undefined){k.style.WebkitUserSelect="none"}else{if(k.style.KhtmlUserSelect!==undefined){k.style.KhtmlUserSelect="none"}}}}}};function e(){var j=document.getElementById("edui_fixedlayer");b.setViewportOffset(j,{left:0,top:0})}function h(j){c.on(window,"scroll",e);c.on(window,"resize",baidu.editor.utils.defer(e,0,true))}})();(function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,c=baidu.editor.EventBase,d=baidu.editor.ui.UIBase=function(){};d.prototype={className:"",uiName:"",initOptions:function(f){var g=this;for(var e in f){g[e]=f[e]}this.id=this.id||"edui"+b.uid()},initUIBase:function(){this._globalKey=a.unhtml(b.setGlobal(this.id,this))},render:function(f){var e=this.renderHtml();var g=b.createElementByHtml(e);var h=this.getDom();if(h!=null){h.parentNode.replaceChild(g,h);b.copyAttributes(g,h)}else{if(typeof f=="string"){f=document.getElementById(f)}f=f||b.getFixedLayer();f.appendChild(g)}this.postRender()},getDom:function(e){if(!e){return document.getElementById(this.id)}else{return document.getElementById(this.id+"_"+e)}},postRender:function(){this.fireEvent("postrender")},getHtmlTpl:function(){return""},formatHtml:function(e){var f="edui-"+this.uiName;return(e.replace(/##/g,this.id).replace(/%%-/g,this.uiName?f+"-":"").replace(/%%/g,(this.uiName?f:"")+" "+this.className).replace(/\$\$/g,this._globalKey))},renderHtml:function(){return this.formatHtml(this.getHtmlTpl())},dispose:function(){var e=this.getDom();if(e){baidu.editor.dom.domUtils.remove(e)}b.unsetGlobal(this.id)}};a.inherits(d,c)})();(function(){var a=baidu.editor.utils,b=baidu.editor.ui.UIBase,c=baidu.editor.ui.Separator=function(d){this.initOptions(d);this.initSeparator()};c.prototype={uiName:"separator",initSeparator:function(){this.initUIBase()},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"></div>'}};a.inherits(c,b)})();(function(){var b=baidu.editor.utils,a=baidu.editor.dom.domUtils,d=baidu.editor.ui.UIBase,c=baidu.editor.ui.uiUtils;var e=baidu.editor.ui.Mask=function(f){this.initOptions(f);this.initUIBase()};e.prototype={getHtmlTpl:function(){return'<div id="##" class="edui-mask %%" onmousedown="return $$._onMouseDown(event, this);"></div>'},postRender:function(){var f=this;a.on(window,"resize",function(){setTimeout(function(){if(!f.isHidden()){f._fill()}})})},show:function(f){this._fill();this.getDom().style.display="";this.getDom().style.zIndex=f},hide:function(){this.getDom().style.display="none";this.getDom().style.zIndex=""},isHidden:function(){return this.getDom().style.display=="none"},_onMouseDown:function(){return false},_fill:function(){var f=this.getDom();var g=c.getViewportRect();f.style.width=g.width+"px";f.style.height=g.height+"px"}};b.inherits(e,d)})();(function(){var c=baidu.editor.utils,e=baidu.editor.ui.uiUtils,a=baidu.editor.dom.domUtils,h=baidu.editor.ui.UIBase,g=baidu.editor.ui.Popup=function(i){this.initOptions(i);this.initPopup()};var b=[];function f(l){var m=[];for(var k=0;k<b.length;k++){var j=b[k];if(!j.isHidden()){if(j.queryAutoHide(l)!==false){j.hide()}}}}g.postHide=f;var d=["edui-anchor-topleft","edui-anchor-topright","edui-anchor-bottomleft","edui-anchor-bottomright"];g.prototype={SHADOW_RADIUS:5,content:null,_hidden:false,autoRender:true,canSideLeft:true,canSideUp:true,initPopup:function(){this.initUIBase();b.push(this)},getHtmlTpl:function(){return'<div id="##" class="edui-popup %%"> <div id="##_body" class="edui-popup-body"> <iframe style="position:absolute;z-index:-1;left:0;top:0;background-color: white;" frameborder="0" width="100%" height="100%" src="javascript:"></iframe> <div class="edui-shadow"></div> <div id="##_content" class="edui-popup-content">'+this.getContentHtmlTpl()+"  </div> </div></div>"},getContentHtmlTpl:function(){if(this.content){if(typeof this.content=="string"){return this.content}return this.content.renderHtml()}else{return""}},_UIBase_postRender:h.prototype.postRender,postRender:function(){if(this.content instanceof h){this.content.postRender()}this.fireEvent("postRenderAfter");this.hide(true);this._UIBase_postRender()},_doAutoRender:function(){if(!this.getDom()&&this.autoRender){this.render()}},mesureSize:function(){var i=this.getDom("content");return e.getClientRect(i)},fitSize:function(){var i=this.getDom("body");i.style.width="";i.style.height="";var j=this.mesureSize();i.style.width=j.width+"px";i.style.height=j.height+"px";return j},showAnchor:function(j,i){this.showAnchorRect(e.getClientRect(j),i)},showAnchorRect:function(q,m,n){this._doAutoRender();var k=e.getViewportRect();this._show();var j=this.fitSize();var r,l,i,o;if(m){r=this.canSideLeft&&(q.right+j.width>k.right&&q.left>j.width);l=this.canSideUp&&(q.top+j.height>k.bottom&&q.bottom>j.height);i=(r?q.left-j.width:q.right);o=(l?q.bottom-j.height:q.top)}else{r=this.canSideLeft&&(q.right+j.width>k.right&&q.left>j.width);l=this.canSideUp&&(q.top+j.height>k.bottom&&q.bottom>j.height);i=(r?q.right-j.width:q.left);o=(l?q.top-j.height:q.bottom)}var s=this.getDom();e.setViewportOffset(s,{left:i,top:o});a.removeClasses(s,d);s.className+=" "+d[(l?1:0)*2+(r?1:0)];if(this.editor){s.style.zIndex=this.editor.container.style.zIndex*1+10;baidu.editor.ui.uiUtils.getFixedLayer().style.zIndex=s.style.zIndex-1}},showAt:function(l){var k=l.left;var j=l.top;var i={left:k,top:j,right:k,bottom:j,height:0,width:0};this.showAnchorRect(i,false,true)},_show:function(){if(this._hidden){var i=this.getDom();i.style.display="";this._hidden=false;this.fireEvent("show")}},isHidden:function(){return this._hidden},show:function(){this._doAutoRender();this._show()},hide:function(i){if(!this._hidden&&this.getDom()){this.getDom().style.display="none";this._hidden=true;if(!i){this.fireEvent("hide")}}},queryAutoHide:function(i){return !i||!e.contains(this.getDom(),i)}};c.inherits(g,h);a.on(document,"mousedown",function(i){var j=i.target||i.srcElement;f(j)});a.on(window,"scroll",function(){f()})})();(function(){var a=baidu.editor.utils,c=baidu.editor.ui.UIBase,b=baidu.editor.ui.ColorPicker=function(f){this.initOptions(f);this.noColorText=this.noColorText||this.editor.getLang("clearColor");this.initUIBase()};b.prototype={getHtmlTpl:function(){return e(this.noColorText,this.editor)},_onTableClick:function(f){var h=f.target||f.srcElement;var g=h.getAttribute("data-color");if(g){this.fireEvent("pickcolor",g)}},_onTableOver:function(f){var h=f.target||f.srcElement;var g=h.getAttribute("data-color");if(g){this.getDom("preview").style.backgroundColor=g}},_onTableOut:function(){this.getDom("preview").style.backgroundColor=""},_onPickNoColor:function(){this.fireEvent("picknocolor")}};a.inherits(b,c);var d=("ffffff,000000,eeece1,1f497d,4f81bd,c0504d,9bbb59,8064a2,4bacc6,f79646,f2f2f2,7f7f7f,ddd9c3,c6d9f0,dbe5f1,f2dcdb,ebf1dd,e5e0ec,dbeef3,fdeada,d8d8d8,595959,c4bd97,8db3e2,b8cce4,e5b9b7,d7e3bc,ccc1d9,b7dde8,fbd5b5,bfbfbf,3f3f3f,938953,548dd4,95b3d7,d99694,c3d69b,b2a2c7,92cddc,fac08f,a5a5a5,262626,494429,17365d,366092,953734,76923c,5f497a,31859b,e36c09,7f7f7f,0c0c0c,1d1b10,0f243e,244061,632423,4f6128,3f3151,205867,974806,c00000,ff0000,ffc000,ffff00,92d050,00b050,00b0f0,0070c0,002060,7030a0,").split(",");function e(f,j){var h='<div id="##" class="edui-colorpicker %%"><div class="edui-colorpicker-topbar edui-clearfix"><div unselectable="on" id="##_preview" class="edui-colorpicker-preview"></div><div unselectable="on" class="edui-colorpicker-nocolor" onclick="$$._onPickNoColor(event, this);">'+f+'</div></div><table  class="edui-box" style="border-collapse: collapse;" onmouseover="$$._onTableOver(event, this);" onmouseout="$$._onTableOut(event, this);" onclick="return $$._onTableClick(event, this);" cellspacing="0" cellpadding="0"><tr style="border-bottom: 1px solid #ddd;font-size: 13px;line-height: 25px;color:#366092;padding-top: 2px"><td colspan="10">'+j.getLang("themeColor")+'</td> </tr><tr class="edui-colorpicker-tablefirstrow" >';for(var g=0;g<d.length;g++){if(g&&g%10===0){h+="</tr>"+(g==60?'<tr style="border-bottom: 1px solid #ddd;font-size: 13px;line-height: 25px;color:#366092;"><td colspan="10">'+j.getLang("standardColor")+"</td></tr>":"")+"<tr"+(g==60?' class="edui-colorpicker-tablefirstrow"':"")+">"}h+=g<70?'<td style="padding: 0 2px;"><a hidefocus title="'+d[g]+'" onclick="return false;" href="javascript:" unselectable="on" class="edui-box edui-colorpicker-colorcell" data-color="#'+d[g]+'" style="background-color:#'+d[g]+";border:solid #ccc;"+(g<10||g>=60?"border-width:1px;":g>=10&&g<20?"border-width:1px 1px 0 1px;":"border-width:0 1px 0 1px;")+'"></a></td>':""}h+="</tr></table></div>";return h}})();(function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,c=baidu.editor.ui.UIBase;var d=baidu.editor.ui.TablePicker=function(e){this.initOptions(e);this.initTablePicker()};d.prototype={defaultNumRows:10,defaultNumCols:10,maxNumRows:20,maxNumCols:20,numRows:10,numCols:10,lengthOfCellSide:22,initTablePicker:function(){this.initUIBase()},getHtmlTpl:function(){var e=this;return'<div id="##" class="edui-tablepicker %%"><div class="edui-tablepicker-body"><div class="edui-infoarea"><span id="##_label" class="edui-label"></span><span class="edui-clickable" onclick="$$._onMore();">'+e.editor.getLang("more")+'</span></div><div class="edui-pickarea" onmousemove="$$._onMouseMove(event, this);" onmouseover="$$._onMouseOver(event, this);" onmouseout="$$._onMouseOut(event, this);" onclick="$$._onClick(event, this);"><div id="##_overlay" class="edui-overlay"></div></div></div></div>'},_UIBase_render:c.prototype.render,render:function(e){this._UIBase_render(e);this.getDom("label").innerHTML="0"+this.editor.getLang("t_row")+" x 0"+this.editor.getLang("t_col")},_track:function(i,h){var f=this.getDom("overlay").style;var g=this.lengthOfCellSide;f.width=i*g+"px";f.height=h*g+"px";var e=this.getDom("label");e.innerHTML=i+this.editor.getLang("t_col")+" x "+h+this.editor.getLang("t_row");this.numCols=i;this.numRows=h},_onMouseOver:function(f,g){var e=f.relatedTarget||f.fromElement;if(!b.contains(g,e)&&g!==e){this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row");this.getDom("overlay").style.visibility=""}},_onMouseOut:function(f,g){var e=f.relatedTarget||f.toElement;if(!b.contains(g,e)&&g!==e){this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row");this.getDom("overlay").style.visibility="hidden"}},_onMouseMove:function(e,g){var f=this.getDom("overlay").style;var k=b.getEventOffset(e);var i=this.lengthOfCellSide;var j=Math.ceil(k.left/i);var h=Math.ceil(k.top/i);this._track(j,h)},_onClick:function(){this.fireEvent("picktable",this.numCols,this.numRows)},_onMore:function(){this.fireEvent("more")}};a.inherits(d,c)})();(function(){var c=baidu.editor.browser,a=baidu.editor.dom.domUtils,b=baidu.editor.ui.uiUtils;var d='onmousedown="$$.Stateful_onMouseDown(event, this);" onmouseup="$$.Stateful_onMouseUp(event, this);"'+(c.ie?(' onmouseenter="$$.Stateful_onMouseEnter(event, this);" onmouseleave="$$.Stateful_onMouseLeave(event, this);"'):(' onmouseover="$$.Stateful_onMouseOver(event, this);" onmouseout="$$.Stateful_onMouseOut(event, this);"'));baidu.editor.ui.Stateful={alwalysHoverable:false,Stateful_init:function(){this._Stateful_dGetHtmlTpl=this.getHtmlTpl;this.getHtmlTpl=this.Stateful_getHtmlTpl},Stateful_getHtmlTpl:function(){var e=this._Stateful_dGetHtmlTpl();return e.replace(/stateful/g,function(){return d})},Stateful_onMouseEnter:function(e,f){if(!this.isDisabled()||this.alwalysHoverable){this.addState("hover");this.fireEvent("over")}},Stateful_onMouseLeave:function(e,f){if(!this.isDisabled()||this.alwalysHoverable){this.removeState("hover");this.removeState("active");this.fireEvent("out")}},Stateful_onMouseOver:function(f,g){var e=f.relatedTarget;if(!b.contains(g,e)&&g!==e){this.Stateful_onMouseEnter(f,g)}},Stateful_onMouseOut:function(f,g){var e=f.relatedTarget;if(!b.contains(g,e)&&g!==e){this.Stateful_onMouseLeave(f,g)}},Stateful_onMouseDown:function(e,f){if(!this.isDisabled()){this.addState("active")}},Stateful_onMouseUp:function(e,f){if(!this.isDisabled()){this.removeState("active")}},Stateful_postRender:function(){if(this.disabled&&!this.hasState("disabled")){this.addState("disabled")}},hasState:function(e){return a.hasClass(this.getStateDom(),"edui-state-"+e)},addState:function(e){if(!this.hasState(e)){this.getStateDom().className+=" edui-state-"+e}},removeState:function(e){if(this.hasState(e)){a.removeClasses(this.getStateDom(),["edui-state-"+e])}},getStateDom:function(){return this.getDom("state")},isChecked:function(){return this.hasState("checked")},setChecked:function(e){if(!this.isDisabled()&&e){this.addState("checked")}else{this.removeState("checked")}},isDisabled:function(){return this.hasState("disabled")},setDisabled:function(e){if(e){this.removeState("hover");this.removeState("checked");this.removeState("active");this.addState("disabled")}else{this.removeState("disabled")}}}})();(function(){var b=baidu.editor.utils,d=baidu.editor.ui.UIBase,c=baidu.editor.ui.Stateful,a=baidu.editor.ui.Button=function(e){this.initOptions(e);this.initButton()};a.prototype={uiName:"button",label:"",title:"",showIcon:true,showText:true,initButton:function(){this.initUIBase();this.Stateful_init()},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"><div id="##_state" stateful><div class="%%-wrap"><div id="##_body" unselectable="on" '+(this.title?'title="'+this.title+'"':"")+' class="%%-body" onmousedown="return false;" onclick="return $$._onClick();">'+(this.showIcon?'<div class="edui-box edui-icon"></div>':"")+(this.showText?'<div class="edui-box edui-label">'+this.label+"</div>":"")+"</div></div></div></div>"},postRender:function(){this.Stateful_postRender();this.setDisabled(this.disabled)},_onClick:function(){if(!this.isDisabled()){this.fireEvent("click")}}};b.inherits(a,d);b.extend(a.prototype,c)})();(function(){var c=baidu.editor.utils,e=baidu.editor.ui.uiUtils,a=baidu.editor.dom.domUtils,f=baidu.editor.ui.UIBase,d=baidu.editor.ui.Stateful,b=baidu.editor.ui.SplitButton=function(g){this.initOptions(g);this.initSplitButton()};b.prototype={popup:null,uiName:"splitbutton",title:"",initSplitButton:function(){this.initUIBase();this.Stateful_init();var h=this;if(this.popup!=null){var g=this.popup;this.popup=null;this.setPopup(g)}},_UIBase_postRender:f.prototype.postRender,postRender:function(){this.Stateful_postRender();this._UIBase_postRender()},setPopup:function(g){if(this.popup===g){return}if(this.popup!=null){this.popup.dispose()}g.addListener("show",c.bind(this._onPopupShow,this));g.addListener("hide",c.bind(this._onPopupHide,this));g.addListener("postrender",c.bind(function(){g.getDom("body").appendChild(e.createElementByHtml('<div id="'+this.popup.id+'_bordereraser" class="edui-bordereraser edui-background" style="width:'+(e.getClientRect(this.getDom()).width-2)+'px"></div>'));g.getDom().className+=" "+this.className},this));this.popup=g},_onPopupShow:function(){this.addState("opened")},_onPopupHide:function(){this.removeState("opened")},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"><div '+(this.title?'title="'+this.title+'"':"")+' id="##_state" stateful><div class="%%-body"><div id="##_button_body" class="edui-box edui-button-body" onclick="$$._onButtonClick(event, this);"><div class="edui-box edui-icon"></div></div><div class="edui-box edui-splitborder"></div><div class="edui-box edui-arrow" onclick="$$._onArrowClick();"></div></div></div></div>'},showPopup:function(){var g=e.getClientRect(this.getDom());g.top-=this.popup.SHADOW_RADIUS;g.height+=this.popup.SHADOW_RADIUS;this.popup.showAnchorRect(g)},_onArrowClick:function(h,g){if(!this.isDisabled()){this.showPopup()}},_onButtonClick:function(){if(!this.isDisabled()){this.fireEvent("buttonclick")}}};c.inherits(b,f);c.extend(b.prototype,d,true)})();(function(){var b=baidu.editor.utils,c=baidu.editor.ui.uiUtils,d=baidu.editor.ui.ColorPicker,f=baidu.editor.ui.Popup,a=baidu.editor.ui.SplitButton,e=baidu.editor.ui.ColorButton=function(g){this.initOptions(g);this.initColorButton()};e.prototype={initColorButton:function(){var g=this;this.popup=new f({content:new d({noColorText:g.editor.getLang("clearColor"),editor:g.editor,onpickcolor:function(i,h){g._onPickColor(h)},onpicknocolor:function(i,h){g._onPickNoColor(h)}}),editor:g.editor});this.initSplitButton()},_SplitButton_postRender:a.prototype.postRender,postRender:function(){this._SplitButton_postRender();this.getDom("button_body").appendChild(c.createElementByHtml('<div id="'+this.id+'_colorlump" class="edui-colorlump"></div>'));this.getDom().className+=" edui-colorbutton"},setColor:function(g){this.getDom("colorlump").style.backgroundColor=g;this.color=g},_onPickColor:function(g){if(this.fireEvent("pickcolor",g)!==false){this.setColor(g);this.popup.hide()}},_onPickNoColor:function(g){if(this.fireEvent("picknocolor")!==false){this.popup.hide()}}};b.inherits(e,a)})();(function(){var b=baidu.editor.utils,c=baidu.editor.ui.Popup,d=baidu.editor.ui.TablePicker,a=baidu.editor.ui.SplitButton,e=baidu.editor.ui.TableButton=function(f){this.initOptions(f);this.initTableButton()};e.prototype={initTableButton:function(){var f=this;this.popup=new c({content:new d({editor:f.editor,onpicktable:function(g,i,h){f._onPickTable(i,h)},onmore:function(){f.popup.hide();f.fireEvent("more")}}),editor:f.editor});this.initSplitButton()},_onPickTable:function(g,f){if(this.fireEvent("picktable",g,f)!==false){this.popup.hide()}}};b.inherits(e,a)})();(function(){var a=baidu.editor.utils,b=baidu.editor.ui.UIBase;var c=baidu.editor.ui.AutoTypeSetPicker=function(d){this.initOptions(d);this.initAutoTypeSetPicker()};c.prototype={initAutoTypeSetPicker:function(){this.initUIBase()},getHtmlTpl:function(){var e=this.editor,d=e.options.autotypeset,f=e.getLang("autoTypeSet");return'<div id="##" class="edui-autotypesetpicker %%"><div class="edui-autotypesetpicker-body"><table ><tr><td colspan="2"><input type="checkbox" name="mergeEmptyline" '+(d.mergeEmptyline?"checked":"")+">"+f.mergeLine+'</td><td colspan="2"><input type="checkbox" name="removeEmptyline" '+(d.removeEmptyline?"checked":"")+">"+f.delLine+'</td></tr><tr><td colspan="2"><input type="checkbox" name="removeClass" '+(d.removeClass?"checked":"")+">"+f.removeFormat+'</td><td colspan="2"><input type="checkbox" name="indent" '+(d.indent?"checked":"")+">"+f.indent+'</td></tr><tr><td colspan="2"><input type="checkbox" name="textAlign" '+(d.textAlign?"checked":"")+">"+f.alignment+'</td><td colspan="2" id="textAlignValue"><input type="radio" name="textAlignValue" value="left" '+((d.textAlign&&d.textAlign=="left")?"checked":"")+">"+e.getLang("justifyleft")+'<input type="radio" name="textAlignValue" value="center" '+((d.textAlign&&d.textAlign=="center")?"checked":"")+">"+e.getLang("justifycenter")+'<input type="radio" name="textAlignValue" value="right" '+((d.textAlign&&d.textAlign=="right")?"checked":"")+">"+e.getLang("justifyright")+' </tr><tr><td colspan="2"><input type="checkbox" name="imageBlockLine" '+(d.imageBlockLine?"checked":"")+">"+f.imageFloat+'</td><td colspan="2" id="imageBlockLineValue"><input type="radio" name="imageBlockLineValue" value="none" '+((d.imageBlockLine&&d.imageBlockLine=="none")?"checked":"")+">"+e.getLang("default")+'<input type="radio" name="imageBlockLineValue" value="left" '+((d.imageBlockLine&&d.imageBlockLine=="left")?"checked":"")+">"+e.getLang("justifyleft")+'<input type="radio" name="imageBlockLineValue" value="center" '+((d.imageBlockLine&&d.imageBlockLine=="center")?"checked":"")+">"+e.getLang("justifycenter")+'<input type="radio" name="imageBlockLineValue" value="right" '+((d.imageBlockLine&&d.imageBlockLine=="right")?"checked":"")+">"+e.getLang("justifyright")+'</tr><tr><td colspan="2"><input type="checkbox" name="clearFontSize" '+(d.clearFontSize?"checked":"")+">"+f.removeFontsize+'</td><td colspan="2"><input type="checkbox" name="clearFontFamily" '+(d.clearFontFamily?"checked":"")+">"+f.removeFontFamily+'</td></tr><tr><td colspan="4"><input type="checkbox" name="removeEmptyNode" '+(d.removeEmptyNode?"checked":"")+">"+f.removeHtml+'</td></tr><tr><td colspan="4"><input type="checkbox" name="pasteFilter" '+(d.pasteFilter?"checked":"")+">"+f.pasteFilter+'</td></tr><tr><td colspan="4" align="right"><button >'+f.run+"</button></td></tr></table></div></div>"},_UIBase_render:b.prototype.render};a.inherits(c,b)})();(function(){var b=baidu.editor.utils,d=baidu.editor.ui.Popup,e=baidu.editor.ui.AutoTypeSetPicker,a=baidu.editor.ui.SplitButton,f=baidu.editor.ui.AutoTypeSetButton=function(g){this.initOptions(g);this.initAutoTypeSetButton()};function c(s){var h=s.editor.options.autotypeset,w=s.getDom(),q=domUtils.getElementsByTagName(w,"input");for(var m=q.length-1,v;v=q[m--];){if(v.getAttribute("type")=="checkbox"){var t=v.getAttribute("name");h[t]&&delete h[t];if(v.checked){var n=document.getElementById(t+"Value");if(n){if(/input/ig.test(n.tagName)){h[t]=n.value}else{var g=n.getElementsByTagName("input");for(var k=g.length-1,u;u=g[k--];){if(u.checked){h[t]=u.value;break}}}}else{h[t]=true}}}}var r=domUtils.getElementsByTagName(w,"select");for(var m=0,l;l=r[m++];){var o=l.getAttribute("name");h[o]=h[o]?l.value:""}s.editor.options.autotypeset=h}f.prototype={initAutoTypeSetButton:function(){var h=this;this.popup=new d({content:new e({editor:h.editor}),editor:h.editor,hide:function(){if(!this._hidden&&this.getDom()){c(this);this.getDom().style.display="none";this._hidden=true;this.fireEvent("hide")}}});var g=0;this.popup.addListener("postRenderAfter",function(){var j=this;if(g){return}var i=this.getDom(),k=i.getElementsByTagName("button")[0];k.onclick=function(){c(j);h.editor.execCommand("autotypeset")};g=1});this.initSplitButton()}};b.inherits(f,a)})();(function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,d=baidu.editor.ui.UIBase,c=baidu.editor.ui.Toolbar=function(e){this.initOptions(e);this.initToolbar()};c.prototype={items:null,initToolbar:function(){this.items=this.items||[];this.initUIBase()},add:function(e){this.items.push(e)},getHtmlTpl:function(){var f=[];for(var e=0;e<this.items.length;e++){f[e]=this.items[e].renderHtml()}return'<div id="##" class="edui-toolbar %%" onselectstart="return false;" onmousedown="return $$._onMouseDown(event, this);">'+f.join("")+"</div>"},postRender:function(){var f=this.getDom();for(var e=0;e<this.items.length;e++){this.items[e].postRender()}b.makeUnselectable(f)},_onMouseDown:function(){return false}};a.inherits(c,d)})();(function(){var h=baidu.editor.utils,d=baidu.editor.dom.domUtils,b=baidu.editor.ui.uiUtils,c=baidu.editor.ui.UIBase,i=baidu.editor.ui.Popup,a=baidu.editor.ui.Stateful,e=baidu.editor.ui.Menu=function(j){this.initOptions(j);this.initMenu()};var f={renderHtml:function(){return'<div class="edui-menuitem edui-menuseparator"><div class="edui-menuseparator-inner"></div></div>'},postRender:function(){},queryAutoHide:function(){return true}};e.prototype={items:null,uiName:"menu",initMenu:function(){this.items=this.items||[];this.initPopup();this.initItems()},initItems:function(){for(var j=0;j<this.items.length;j++){var k=this.items[j];if(k=="-"){this.items[j]=this.getSeparator()}else{if(!(k instanceof g)){this.items[j]=this.createItem(k)}}}},getSeparator:function(){return f},createItem:function(j){return new g(j)},_Popup_getContentHtmlTpl:i.prototype.getContentHtmlTpl,getContentHtmlTpl:function(){if(this.items.length==0){return this._Popup_getContentHtmlTpl()}var l=[];for(var j=0;j<this.items.length;j++){var k=this.items[j];l[j]=k.renderHtml()}return('<div class="%%-body">'+l.join("")+"</div>")},_Popup_postRender:i.prototype.postRender,postRender:function(){var l=this;for(var j=0;j<this.items.length;j++){var k=this.items[j];k.ownerMenu=this;k.postRender()}d.on(this.getDom(),"mouseover",function(n){n=n||event;var m=n.relatedTarget||n.fromElement;var o=l.getDom();if(!b.contains(o,m)&&o!==m){l.fireEvent("over")}});this._Popup_postRender()},queryAutoHide:function(k){if(k){if(b.contains(this.getDom(),k)){return false}for(var j=0;j<this.items.length;j++){var l=this.items[j];if(l.queryAutoHide(k)===false){return false}}}},clearItems:function(){for(var j=0;j<this.items.length;j++){var k=this.items[j];clearTimeout(k._showingTimer);clearTimeout(k._closingTimer);if(k.subMenu){k.subMenu.destroy()}}this.items=[]},destroy:function(){if(this.getDom()){d.remove(this.getDom())}this.clearItems()},dispose:function(){this.destroy()}};h.inherits(e,i);var g=baidu.editor.ui.MenuItem=function(j){this.initOptions(j);this.initUIBase();this.Stateful_init();if(this.subMenu&&!(this.subMenu instanceof e)){this.subMenu=new e(this.subMenu)}};g.prototype={label:"",subMenu:null,ownerMenu:null,uiName:"menuitem",alwalysHoverable:true,getHtmlTpl:function(){return'<div id="##" class="%%" stateful onclick="$$._onClick(event, this);"><div class="%%-body">'+this.renderLabelHtml()+"</div></div>"},postRender:function(){var j=this;this.addListener("over",function(){j.ownerMenu.fireEvent("submenuover",j);if(j.subMenu){j.delayShowSubMenu()}});if(this.subMenu){this.getDom().className+=" edui-hassubmenu";this.subMenu.render();this.addListener("out",function(){j.delayHideSubMenu()});this.subMenu.addListener("over",function(){clearTimeout(j._closingTimer);j._closingTimer=null;j.addState("opened")});this.ownerMenu.addListener("hide",function(){j.hideSubMenu()});this.ownerMenu.addListener("submenuover",function(l,k){if(k!==j){j.delayHideSubMenu()}});this.subMenu._bakQueryAutoHide=this.subMenu.queryAutoHide;this.subMenu.queryAutoHide=function(k){if(k&&b.contains(j.getDom(),k)){return false}return this._bakQueryAutoHide(k)}}this.getDom().style.tabIndex="-1";b.makeUnselectable(this.getDom());this.Stateful_postRender()},delayShowSubMenu:function(){var j=this;if(!j.isDisabled()){j.addState("opened");clearTimeout(j._showingTimer);clearTimeout(j._closingTimer);j._closingTimer=null;j._showingTimer=setTimeout(function(){j.showSubMenu()},250)}},delayHideSubMenu:function(){var j=this;if(!j.isDisabled()){j.removeState("opened");clearTimeout(j._showingTimer);if(!j._closingTimer){j._closingTimer=setTimeout(function(){if(!j.hasState("opened")){j.hideSubMenu()}j._closingTimer=null},400)}}},renderLabelHtml:function(){return'<div class="edui-arrow"></div><div class="edui-box edui-icon"></div><div class="edui-box edui-label %%-label">'+(this.label||"")+"</div>"},getStateDom:function(){return this.getDom()},queryAutoHide:function(j){if(this.subMenu&&this.hasState("opened")){return this.subMenu.queryAutoHide(j)}},_onClick:function(j,k){if(this.hasState("disabled")){return}if(this.fireEvent("click",j,k)!==false){if(this.subMenu){this.showSubMenu()}else{i.postHide()}}},showSubMenu:function(){var j=b.getClientRect(this.getDom());j.right-=5;j.left+=2;j.width-=7;j.top-=4;j.bottom+=4;j.height+=8;this.subMenu.showAnchorRect(j,true,true)},hideSubMenu:function(){this.subMenu.hide()}};h.inherits(g,c);h.extend(g.prototype,a,true)})();(function(){var b=baidu.editor.utils,d=baidu.editor.ui.uiUtils,e=baidu.editor.ui.Menu,a=baidu.editor.ui.SplitButton,c=baidu.editor.ui.Combox=function(f){this.initOptions(f);this.initCombox()};c.prototype={uiName:"combox",initCombox:function(){var h=this;this.items=this.items||[];for(var f=0;f<this.items.length;f++){var g=this.items[f];g.uiName="listitem";g.index=f;g.onclick=function(){h.selectByIndex(this.index)}}this.popup=new e({items:this.items,uiName:"list",editor:this.editor});this.initSplitButton()},_SplitButton_postRender:a.prototype.postRender,postRender:function(){this._SplitButton_postRender();this.setLabel(this.label||"");this.setValue(this.initValue||"")},showPopup:function(){var f=d.getClientRect(this.getDom());f.top+=1;f.bottom-=1;f.height-=2;this.popup.showAnchorRect(f)},getValue:function(){return this.value},setValue:function(g){var f=this.indexByValue(g);if(f!=-1){this.selectedIndex=f;this.setLabel(this.items[f].label);this.value=this.items[f].value}else{this.selectedIndex=-1;this.setLabel(this.getLabelForUnknowValue(g));this.value=g}},setLabel:function(f){this.getDom("button_body").innerHTML=f;this.label=f},getLabelForUnknowValue:function(f){return f},indexByValue:function(g){for(var f=0;f<this.items.length;f++){if(g==this.items[f].value){return f}}return -1},getItem:function(f){return this.items[f]},selectByIndex:function(f){if(f<this.items.length&&this.fireEvent("select",f)!==false){this.selectedIndex=f;this.value=this.items[f].value;this.setLabel(this.items[f].label)}}};b.inherits(c,a)})();(function(){var h=baidu.editor.utils,d=baidu.editor.dom.domUtils,a=baidu.editor.ui.uiUtils,e=baidu.editor.ui.Mask,b=baidu.editor.ui.UIBase,f=baidu.editor.ui.Button,g=baidu.editor.ui.Dialog=function(j){this.initOptions(h.extend({autoReset:true,draggable:true,onok:function(){},oncancel:function(){},onclose:function(l,k){return k?this.onok():this.oncancel()}},j));this.initDialog()};var c;var i;g.prototype={draggable:false,uiName:"dialog",initDialog:function(){var k=this;this.initUIBase();this.modalMask=(c||(c=new e({className:"edui-dialog-modalmask"})));this.dragMask=(i||(i=new e({className:"edui-dialog-dragmask"})));this.closeButton=new f({className:"edui-dialog-closebutton",title:k.closeDialog,onclick:function(){k.close(false)}});if(this.buttons){for(var j=0;j<this.buttons.length;j++){if(!(this.buttons[j] instanceof f)){this.buttons[j]=new f(this.buttons[j])}}}},fitSize:function(){var j=this.getDom("body");var k=this.mesureSize();j.style.width=k.width+"px";j.style.height=k.height+"px";return k},safeSetOffset:function(q){var l=this;var j=l.getDom();var o=a.getViewportRect();var k=a.getClientRect(j);var n=q.left;if(n+k.width>o.right){n=o.right-k.width}var m=q.top;if(m+k.height>o.bottom){m=o.bottom-k.height}j.style.left=Math.max(n,0)+"px";j.style.top=Math.max(m,0)+"px"},showAtCenter:function(){this.getDom().style.display="";var o=a.getViewportRect();var j=this.fitSize();var n=this.getDom("titlebar").offsetHeight|0;var m=o.width/2-j.width/2;var l=o.height/2-(j.height-n)/2-n;var k=this.getDom();this.safeSetOffset({left:Math.max(m|0,0),top:Math.max(l|0,0)});if(!d.hasClass(k,"edui-state-centered")){k.className+=" edui-state-centered"}this._show()},getContentHtml:function(){var j="";if(typeof this.content=="string"){j=this.content}else{if(this.iframeUrl){j='<span id="'+this.id+'_contmask" class="dialogcontmask"></span><iframe id="'+this.id+'_iframe" class="%%-iframe" height="100%" width="100%" frameborder="0" src="'+this.iframeUrl+'"></iframe>'}}return j},getHtmlTpl:function(){var k="";if(this.buttons){var l=[];for(var j=0;j<this.buttons.length;j++){l[j]=this.buttons[j].renderHtml()}k='<div class="%%-foot"><div id="##_buttons" class="%%-buttons">'+l.join("")+"</div></div>"}return'<div id="##" class="%%"><div class="%%-wrap"><div id="##_body" class="%%-body"><div class="%%-shadow"></div><div id="##_titlebar" class="%%-titlebar"><div class="%%-draghandle" onmousedown="$$._onTitlebarMouseDown(event, this);"><span class="%%-caption">'+(this.title||"")+"</span></div>"+this.closeButton.renderHtml()+'</div><div id="##_content" class="%%-content">'+(this.autoReset?"":this.getContentHtml())+"</div>"+k+"</div></div></div>"},postRender:function(){if(!this.modalMask.getDom()){this.modalMask.render();this.modalMask.hide()}if(!this.dragMask.getDom()){this.dragMask.render();this.dragMask.hide()}var k=this;this.addListener("show",function(){k.modalMask.show(this.getDom().style.zIndex-2)});this.addListener("hide",function(){k.modalMask.hide()});if(this.buttons){for(var j=0;j<this.buttons.length;j++){this.buttons[j].postRender()}}d.on(window,"resize",function(){setTimeout(function(){if(!k.isHidden()){k.safeSetOffset(a.getClientRect(k.getDom()))}})});this._hide()},mesureSize:function(){var j=this.getDom("body");var k=a.getClientRect(this.getDom("content")).width;var l=j.style;l.width=k;return a.getClientRect(j)},_onTitlebarMouseDown:function(j,k){if(this.draggable){var m;var n=a.getViewportRect();var l=this;a.startDrag(j,{ondragstart:function(){m=a.getClientRect(l.getDom());l.getDom("contmask").style.visibility="visible";l.dragMask.show(l.getDom().style.zIndex-1)},ondragmove:function(o,s){var r=m.left+o;var q=m.top+s;l.safeSetOffset({left:r,top:q})},ondragstop:function(){l.getDom("contmask").style.visibility="hidden";d.removeClasses(l.getDom(),["edui-state-centered"]);l.dragMask.hide()}})}},reset:function(){this.getDom("content").innerHTML=this.getContentHtml()},_show:function(){if(this._hidden){this.getDom().style.display="";this.editor.container.style.zIndex&&(this.getDom().style.zIndex=this.editor.container.style.zIndex*1+10);this._hidden=false;this.fireEvent("show");baidu.editor.ui.uiUtils.getFixedLayer().style.zIndex=this.getDom().style.zIndex-4}},isHidden:function(){return this._hidden},_hide:function(){if(!this._hidden){this.getDom().style.display="none";this.getDom().style.zIndex="";this._hidden=true;this.fireEvent("hide")}},open:function(){if(this.autoReset){try{this.reset()}catch(k){this.render();this.open()}}this.showAtCenter();if(this.iframeUrl){try{this.getDom("iframe").focus()}catch(j){}}},_onCloseButtonClick:function(j,k){this.close(false)},close:function(j){if(this.fireEvent("close",j)!==false){this._hide()}}};h.inherits(g,b)})();(function(){var b=baidu.editor.utils,c=baidu.editor.ui.Menu,a=baidu.editor.ui.SplitButton,d=baidu.editor.ui.MenuButton=function(e){this.initOptions(e);this.initMenuButton()};d.prototype={initMenuButton:function(){var e=this;this.uiName="menubutton";this.popup=new c({items:e.items,className:e.className,editor:e.editor});this.popup.addListener("show",function(){var g=this;for(var f=0;f<g.items.length;f++){g.items[f].removeState("checked");if(g.items[f].value==e._value){g.items[f].addState("checked");this.value=e._value}}});this.initSplitButton()},setValue:function(e){this._value=e}};b.inherits(d,a)})();(function(){var o=baidu.editor.utils;var k=baidu.editor.ui;var e=k.Dialog;k.Dialog=function(i){var l=new e(i);l.addListener("hide",function(){if(l.editor){var v=l.editor;try{if(browser.gecko){var w=v.window.scrollY,r=v.window.scrollX;v.body.focus();v.window.scrollTo(r,w)}else{v.focus()}}catch(u){}}});return l};var f={anchor:"~/dialogs/anchor/anchor.html",insertimage:"~/dialogs/image/image.html",inserttable:"~/dialogs/table/table.html",link:"~/dialogs/link/link.html",spechars:"~/dialogs/spechars/spechars.html",searchreplace:"~/dialogs/searchreplace/searchreplace.html",map:"~/dialogs/map/map.html",gmap:"~/dialogs/gmap/gmap.html",insertvideo:"~/dialogs/video/video.html",help:"~/dialogs/help/help.html",highlightcode:"~/dialogs/highlightcode/highlightcode.html",emotion:"~/dialogs/emotion/emotion.html",wordimage:"~/dialogs/wordimage/wordimage.html",attachment:"~/dialogs/attachment/attachment.html",insertframe:"~/dialogs/insertframe/insertframe.html",edittd:"~/dialogs/table/edittd.html",webapp:"~/dialogs/webapp/webapp.html",snapscreen:"~/dialogs/snapscreen/snapscreen.html",scrawl:"~/dialogs/scrawl/scrawl.html",template:"~/dialogs/template/template.html",background:"~/dialogs/background/background.html"};var j=["undo","redo","formatmatch","bold","italic","underline","touppercase","tolowercase","strikethrough","subscript","superscript","source","indent","outdent","blockquote","pasteplain","pagebreak","selectall","print","preview","horizontal","removeformat","time","date","unlink","insertparagraphbeforetable","insertrow","insertcol","mergeright","mergedown","deleterow","deletecol","splittorows","splittocols","splittocells","mergecells","deletetable"];for(var g=0,t;t=j[g++];){t=t.toLowerCase();k[t]=function(i){return function(l){var r=new k.Button({className:"edui-for-"+i,title:l.options.labelMap[i]||l.getLang("labelMap."+i)||"",onclick:function(){l.execCommand(i)},showText:false});l.addListener("selectionchange",function(v,u,x){var w=l.queryCommandState(i);if(w==-1){r.setDisabled(true);r.setChecked(false)}else{if(!x){r.setDisabled(false);r.setChecked(w)}}});return r}}(t)}k.cleardoc=function(i){var l=new k.Button({className:"edui-for-cleardoc",title:i.options.labelMap.cleardoc||i.getLang("labelMap.cleardoc")||"",onclick:function(){if(confirm(i.getLang("confirmClear"))){i.execCommand("cleardoc")}}});i.addListener("selectionchange",function(){l.setDisabled(i.queryCommandState("cleardoc")==-1)});return l};var n={justify:["left","right","center","justify"],imagefloat:["none","left","center","right"],directionality:["ltr","rtl"]};for(var b in n){(function(u,v){for(var r=0,l;l=v[r++];){(function(i){k[u.replace("float","")+i]=function(w){var x=new k.Button({className:"edui-for-"+u.replace("float","")+i,title:w.options.labelMap[u.replace("float","")+i]||w.getLang("labelMap."+u.replace("float","")+i)||"",onclick:function(){w.execCommand(u,i)}});w.addListener("selectionchange",function(z,y,A){x.setDisabled(w.queryCommandState(u)==-1);x.setChecked(w.queryCommandValue(u)==i&&!A)});return x}})(l)}})(b,n[b])}for(var g=0,t;t=["backcolor","forecolor"][g++];){k[t]=function(i){return function(l){var r=new k.ColorButton({className:"edui-for-"+i,color:"default",title:l.options.labelMap[i]||l.getLang("labelMap."+i)||"",editor:l,onpickcolor:function(v,u){l.execCommand(i,u)},onpicknocolor:function(){l.execCommand(i,"default");this.setColor("transparent");this.color="default"},onbuttonclick:function(){l.execCommand(i,this.color)}});l.addListener("selectionchange",function(){r.setDisabled(l.queryCommandState(i)==-1)});return r}}(t)}var h={noOk:["searchreplace","help","spechars","webapp"],ok:["attachment","anchor","link","insertimage","map","gmap","insertframe","wordimage","insertvideo","highlightcode","insertframe","edittd","scrawl","template","background"]};for(var b in h){(function(u,v){for(var r=0,l;l=v[r++];){if(browser.opera&&l==="searchreplace"){continue}(function(i){k[i]=function(y,x,A){x=x||(y.options.iframeUrlMap||{})[i]||f[i];A=y.options.labelMap[i]||y.getLang("labelMap."+i)||"";var w;if(x){w=new k.Dialog(o.extend({iframeUrl:y.ui.mapUrl(x),editor:y,className:"edui-for-"+i,title:A,closeDialog:y.getLang("closeDialog")},u=="ok"?{buttons:[{className:"edui-okbutton",label:y.getLang("ok"),onclick:function(){w.close(true)}},{className:"edui-cancelbutton",label:y.getLang("cancel"),onclick:function(){w.close(false)}}]}:{}));y.ui._dialogs[i+"Dialog"]=w}var z=new k.Button({className:"edui-for-"+i,title:A,onclick:function(){if(w){switch(i){case"wordimage":y.execCommand("wordimage","word_img");if(y.word_img){w.render();w.open()}break;case"scrawl":if(y.queryCommandState("scrawl")!=-1){w.render();w.open()}break;default:w.render();w.open()}}},disabled:i=="scrawl"&&y.queryCommandState("scrawl")==-1});y.addListener("selectionchange",function(){var B={edittd:1,edittable:1};if(i in B){return}var C=y.queryCommandState(i);z.setDisabled(C==-1);z.setChecked(C)});return z}})(l.toLowerCase())}})(b,h[b])}k.snapscreen=function(r,l,v){v=r.options.labelMap.snapscreen||r.getLang("labelMap.snapscreen")||"";var u=new k.Button({className:"edui-for-snapscreen",title:v,onclick:function(){r.execCommand("snapscreen")},disabled:!browser.ie});if(browser.ie){l=l||(r.options.iframeUrlMap||{})["snapscreen"]||f.snapscreen;if(l){var i=new k.Dialog({iframeUrl:r.ui.mapUrl(l),editor:r,className:"edui-for-snapscreen",title:v,buttons:[{className:"edui-okbutton",label:r.getLang("ok"),onclick:function(){i.close(true)}},{className:"edui-cancelbutton",label:r.getLang("cancel"),onclick:function(){i.close(false)}}]});i.render();r.ui._dialogs.snapscreenDialog=i}}r.addListener("selectionchange",function(){u.setDisabled(r.queryCommandState("snapscreen")==-1)});return u};k.fontfamily=function(v,x,z){x=v.options.fontfamily||[];z=v.options.labelMap.fontfamily||v.getLang("labelMap.fontfamily")||"";for(var u=0,r,l=[];r=x[u];u++){var y=v.getLang("fontfamily")[r.name]||"";(function(i,A){l.push({label:i,value:A,renderLabelHtml:function(){return'<div class="edui-label %%-label" style="font-family:'+o.unhtml(this.value)+'">'+(this.label||"")+"</div>"}})})(r.label||y,r.val)}var w=new k.Combox({editor:v,items:l,onselect:function(A,i){v.execCommand("FontFamily",this.items[i].value)},onbuttonclick:function(){this.showPopup()},title:z,initValue:z,className:"edui-for-fontfamily",indexByValue:function(C){if(C){for(var B=0,A;A=this.items[B];B++){if(A.value.indexOf(C)!=-1){return B}}}return -1}});v.addListener("selectionchange",function(A,i,D){if(!D){var C=v.queryCommandState("FontFamily");if(C==-1){w.setDisabled(true)}else{w.setDisabled(false);var B=v.queryCommandValue("FontFamily");B&&(B=B.replace(/['"]/g,"").split(",")[0]);w.setValue(B)}}});return w};k.fontsize=function(v,x,y){y=v.options.labelMap.fontsize||v.getLang("labelMap.fontsize")||"";x=x||v.options.fontsize||[];var l=[];for(var u=0;u<x.length;u++){var r=x[u]+"px";l.push({label:r,value:r,renderLabelHtml:function(){return'<div class="edui-label %%-label" style="line-height:1;font-size:'+this.value+'">'+(this.label||"")+"</div>"}})}var w=new k.Combox({editor:v,items:l,title:y,initValue:y,onselect:function(z,i){v.execCommand("FontSize",this.items[i].value)},onbuttonclick:function(){this.showPopup()},className:"edui-for-fontsize"});v.addListener("selectionchange",function(z,i,B){if(!B){var A=v.queryCommandState("FontSize");if(A==-1){w.setDisabled(true)}else{w.setDisabled(false);w.setValue(v.queryCommandValue("FontSize"))}}});return w};k.paragraph=function(u,w,x){x=u.options.labelMap.paragraph||u.getLang("labelMap.paragraph")||"";w=u.options.paragraph||[];var l=[];for(var r in w){l.push({value:r,label:w[r]||u.getLang("paragraph")[r],renderLabelHtml:function(){return'<div class="edui-label %%-label"><span class="edui-for-'+this.value+'">'+(this.label||"")+"</span></div>"}})}var v=new k.Combox({editor:u,items:l,title:x,initValue:x,className:"edui-for-paragraph",onselect:function(y,i){u.execCommand("Paragraph",this.items[i].value)},onbuttonclick:function(){this.showPopup()}});u.addListener("selectionchange",function(z,y,C){if(!C){var B=u.queryCommandState("Paragraph");if(B==-1){v.setDisabled(true)}else{v.setDisabled(false);var A=u.queryCommandValue("Paragraph");var i=v.indexByValue(A);if(i!=-1){v.setValue(A)}else{v.setValue(v.initValue)}}}});return v};k.customstyle=function(w){var y=w.options.customstyle||[],z=w.options.labelMap.customstyle||w.getLang("labelMap.customstyle")||"";if(!y){return}var v=w.getLang("customstyle");for(var u=0,l=[],r;r=y[u++];){(function(A){var i={};i.label=A.label?A.label:v[A.name];i.style=A.style;i.className=A.className;i.tag=A.tag;l.push({label:i.label,value:i,renderLabelHtml:function(){return'<div class="edui-label %%-label"><'+i.tag+" "+(i.className?' class="'+i.className+'"':"")+(i.style?' style="'+i.style+'"':"")+">"+i.label+"</"+i.tag+"></div>"}})})(r)}var x=new k.Combox({editor:w,items:l,title:z,initValue:z,className:"edui-for-customstyle",onselect:function(A,i){w.execCommand("customstyle",this.items[i].value)},onbuttonclick:function(){this.showPopup()},indexByValue:function(C){for(var A=0,B;B=this.items[A++];){if(B.label==C){return A-1}}return -1}});w.addListener("selectionchange",function(B,A,E){if(!E){var D=w.queryCommandState("customstyle");if(D==-1){x.setDisabled(true)}else{x.setDisabled(false);var C=w.queryCommandValue("customstyle");var i=x.indexByValue(C);if(i!=-1){x.setValue(C)}else{x.setValue(x.initValue)}}}});return x};k.inserttable=function(u,r,w){r=r||(u.options.iframeUrlMap||{})["inserttable"]||f.inserttable;w=u.options.labelMap.inserttable||u.getLang("labelMap.inserttable")||"";if(r){var l=new k.Dialog({iframeUrl:u.ui.mapUrl(r),editor:u,className:"edui-for-inserttable",title:w,buttons:[{className:"edui-okbutton",label:u.getLang("ok"),onclick:function(){l.close(true)}},{className:"edui-cancelbutton",label:u.getLang("cancel"),onclick:function(){l.close(false)}}]});l.render();u.ui._dialogs.inserttableDialog=l}var i=function(){if(l){if(browser.webkit){l.open();l.close()}l.open()}};var v=new k.TableButton({editor:u,title:w,className:"edui-for-inserttable",onpicktable:function(x,z,y){u.execCommand("InsertTable",{numRows:y,numCols:z,border:1})},onmore:i,onbuttonclick:i});u.addListener("selectionchange",function(){v.setDisabled(u.queryCommandState("inserttable")==-1)});return v};k.lineheight=function(v){var x=v.options.lineheight;for(var u=0,r,l=[];r=x[u++];){l.push({label:r,value:r,onclick:function(){v.execCommand("lineheight",this.value)}})}var w=new k.MenuButton({editor:v,className:"edui-for-lineheight",title:v.options.labelMap.lineheight||v.getLang("labelMap.lineheight")||"",items:l,onbuttonclick:function(){var i=v.queryCommandValue("LineHeight")||this.value;v.execCommand("LineHeight",i)}});v.addListener("selectionchange",function(){var y=v.queryCommandState("LineHeight");if(y==-1){w.setDisabled(true)}else{w.setDisabled(false);var i=v.queryCommandValue("LineHeight");i&&w.setValue((i+"").replace(/cm/,""));w.setChecked(y)}});return w};var c=["top","bottom"];for(var a=0,m;m=c[a++];){(function(i){k["rowspacing"+i]=function(v){var x=v.options["rowspacing"+i];for(var u=0,r,l=[];r=x[u++];){l.push({label:r,value:r,onclick:function(){v.execCommand("rowspacing",this.value,i)}})}var w=new k.MenuButton({editor:v,className:"edui-for-rowspacing"+i,title:v.options.labelMap["rowspacing"+i]||v.getLang("labelMap.rowspacing"+i)||"",items:l,onbuttonclick:function(){var y=v.queryCommandValue("rowspacing",i)||this.value;v.execCommand("rowspacing",y,i)}});v.addListener("selectionchange",function(){var z=v.queryCommandState("rowspacing",i);if(z==-1){w.setDisabled(true)}else{w.setDisabled(false);var y=v.queryCommandValue("rowspacing",i);y&&w.setValue((y+"").replace(/%/,""));w.setChecked(z)}});return w}})(m)}var s=["insertorderedlist","insertunorderedlist"];for(var d=0,q;q=s[d++];){(function(i){k[i]=function(u){var w=u.options[i],x=function(){u.execCommand(i,this.value)},l=[];for(var r in w){l.push({label:w[r]||u.getLang()[i][r]||"",value:r,onclick:x})}var v=new k.MenuButton({editor:u,className:"edui-for-"+i,title:u.getLang("labelMap."+i)||"",items:l,onbuttonclick:function(){var y=u.queryCommandValue(i)||this.value;u.execCommand(i,y)}});u.addListener("selectionchange",function(){var z=u.queryCommandState(i);if(z==-1){v.setDisabled(true)}else{v.setDisabled(false);var y=u.queryCommandValue(i);v.setValue(y);v.setChecked(z)}});return v}})(q)}k.fullscreen=function(i,r){r=i.options.labelMap.fullscreen||i.getLang("labelMap.fullscreen")||"";var l=new k.Button({className:"edui-for-fullscreen",title:r,onclick:function(){if(i.ui){i.ui.setFullScreen(!i.ui.isFullScreen())}this.setChecked(i.ui.isFullScreen())}});i.addListener("selectionchange",function(){var u=i.queryCommandState("fullscreen");l.setDisabled(u==-1);l.setChecked(i.ui.isFullScreen())});return l};k.emotion=function(l,i){var r=new k.MultiMenuPop({title:l.options.labelMap.emotion||l.getLang("labelMap.emotion")||"",editor:l,className:"edui-for-emotion",iframeUrl:l.ui.mapUrl(i||(l.options.iframeUrlMap||{})["emotion"]||f.emotion)});l.addListener("selectionchange",function(){r.setDisabled(l.queryCommandState("emotion")==-1)});return r};k.autotypeset=function(i){var l=new k.AutoTypeSetButton({editor:i,title:i.options.labelMap.autotypeset||i.getLang("labelMap.autotypeset")||"",className:"edui-for-autotypeset",onbuttonclick:function(){i.execCommand("autotypeset")}});i.addListener("selectionchange",function(){l.setDisabled(i.queryCommandState("autotypeset")==-1)});return l}})();(function(){var b=baidu.editor.utils,d=baidu.editor.ui.uiUtils,e=baidu.editor.ui.UIBase,a=baidu.editor.dom.domUtils;function c(f){this.initOptions(f);this.initEditorUI()}c.prototype={uiName:"editor",initEditorUI:function(){this.editor.ui=this;this._dialogs={};this.initUIBase();this._initToolbars();var g=this.editor,h=this;g.addListener("ready",function(){g.getDialog=function(i){return g.ui._dialogs[i+"Dialog"]};a.on(g.window,"scroll",function(){baidu.editor.ui.Popup.postHide()});if(g.options.elementPathEnabled){g.ui.getDom("elementpath").innerHTML='<div class="edui-editor-breadcrumb">'+g.getLang("elementPathTip")+":</div>"}if(g.options.wordCount){g.ui.getDom("wordcount").innerHTML=g.getLang("wordCountTip");g.addListener("keyup",function(j,i){var k=i.keyCode||i.which;if(k==32){h._wordCount()}})}if(!g.options.elementPathEnabled&&!g.options.wordCount){g.ui.getDom("elementpath").style.display="none";g.ui.getDom("wordcount").style.display="none"}if(!g.selection.isFocus()){return}g.fireEvent("selectionchange",false,true)});g.addListener("mousedown",function(j,i){var k=i.target||i.srcElement;baidu.editor.ui.Popup.postHide(k)});g.addListener("contextmenu",function(j,i){baidu.editor.ui.Popup.postHide()});g.addListener("selectionchange",function(){if(g.options.elementPathEnabled){h[(g.queryCommandState("elementpath")==-1?"dis":"en")+"ableElementPath"]()}if(g.options.wordCount){h[(g.queryCommandState("wordcount")==-1?"dis":"en")+"ableWordCount"]()}});var f=new baidu.editor.ui.Popup({editor:g,content:"",className:"edui-bubble",_onEditButtonClick:function(){this.hide();g.ui._dialogs.linkDialog.open()},_onImgEditButtonClick:function(i){this.hide();g.ui._dialogs[i]&&g.ui._dialogs[i].open()},_onImgSetFloat:function(i){this.hide();g.execCommand("imagefloat",i)},_setIframeAlign:function(i){var j=f.anchorEl;var k=j.cloneNode(true);switch(i){case -2:k.setAttribute("align","");break;case -1:k.setAttribute("align","left");break;case 1:k.setAttribute("align","right");break;case 2:k.setAttribute("align","middle");break}j.parentNode.insertBefore(k,j);a.remove(j);f.anchorEl=k;f.showAnchor(f.anchorEl)},_updateIframe:function(){g._iframe=f.anchorEl;g.ui._dialogs.insertframeDialog.open();f.hide()},_onRemoveButtonClick:function(i){g.execCommand(i);this.hide()},queryAutoHide:function(i){if(i&&i.ownerDocument==g.document){if(i.tagName.toLowerCase()=="img"||a.findParentByTagName(i,"a",true)){return i!==f.anchorEl}}return baidu.editor.ui.Popup.prototype.queryAutoHide.call(this,i)}});f.render();if(g.options.imagePopup){g.addListener("mouseover",function(k,i){i=i||window.event;var l=i.target||i.srcElement;if(g.ui._dialogs.insertframeDialog&&/iframe/ig.test(l.tagName)){var j=f.formatHtml("<nobr>"+g.getLang("property")+': <span onclick=$$._setIframeAlign(-2) class="edui-clickable">'+g.getLang("default")+'</span>&nbsp;&nbsp;<span onclick=$$._setIframeAlign(-1) class="edui-clickable">'+g.getLang("justifyleft")+'</span>&nbsp;&nbsp;<span onclick=$$._setIframeAlign(1) class="edui-clickable">'+g.getLang("justifyright")+'</span>&nbsp;&nbsp;<span onclick=$$._setIframeAlign(2) class="edui-clickable">'+g.getLang("justifycenter")+'</span> <span onclick="$$._updateIframe( this);" class="edui-clickable">'+g.getLang("modify")+"</span></nobr>");if(j){f.getDom("content").innerHTML=j;f.anchorEl=l;f.showAnchor(f.anchorEl)}else{f.hide()}}});g.addListener("selectionchange",function(r,l){if(!l){return}var o="",n=g.selection.getRange().getClosedNode(),i=g.ui._dialogs;if(n&&n.tagName=="IMG"){var k="insertimageDialog";if(n.className.indexOf("edui-faked-video")!=-1){k="insertvideoDialog"}if(n.className.indexOf("edui-faked-webapp")!=-1){k="webappDialog"}if(n.src.indexOf("http://api.map.baidu.com")!=-1){k="mapDialog"}if(n.src.indexOf("http://maps.google.com/maps/api/staticmap")!=-1){k="gmapDialog"}if(n.getAttribute("anchorname")){k="anchorDialog";o=f.formatHtml("<nobr>"+g.getLang("property")+': <span onclick=$$._onImgEditButtonClick("anchorDialog") class="edui-clickable">'+g.getLang("modify")+"</span>&nbsp;&nbsp;<span onclick=$$._onRemoveButtonClick('anchor') class=\"edui-clickable\">"+g.getLang("delete")+"</span></nobr>")}if(n.getAttribute("word_img")){g.word_img=[n.getAttribute("word_img")];k="wordimageDialog"}if(!i[k]){return}!o&&(o=f.formatHtml("<nobr>"+g.getLang("property")+': <span onclick=$$._onImgSetFloat("none") class="edui-clickable">'+g.getLang("default")+'</span>&nbsp;&nbsp;<span onclick=$$._onImgSetFloat("left") class="edui-clickable">'+g.getLang("justifyleft")+'</span>&nbsp;&nbsp;<span onclick=$$._onImgSetFloat("right") class="edui-clickable">'+g.getLang("justifyright")+'</span>&nbsp;&nbsp;<span onclick=$$._onImgSetFloat("center") class="edui-clickable">'+g.getLang("justifycenter")+"</span>&nbsp;&nbsp;<span onclick=\"$$._onImgEditButtonClick('"+k+'\');" class="edui-clickable">'+g.getLang("modify")+"</span></nobr>"))}if(g.ui._dialogs.linkDialog){var q=a.findParentByTagName(g.selection.getStart(),"a",true);var j;if(q&&(j=(q.getAttribute("data_ue_src")||q.getAttribute("href",2)))){var m=j;if(j.length>30){m=j.substring(0,20)+"..."}if(o){o+='<div style="height:5px;"></div>'}o+=f.formatHtml("<nobr>"+g.getLang("anthorMsg")+': <a target="_blank" href="'+j+'" title="'+j+'" >'+m+'</a> <span class="edui-clickable" onclick="$$._onEditButtonClick();">'+g.getLang("modify")+'</span> <span class="edui-clickable" onclick="$$._onRemoveButtonClick(\'unlink\');"> '+g.getLang("clear")+"</span></nobr>");f.showAnchor(q)}}if(o){f.getDom("content").innerHTML=o;f.anchorEl=n||q;f.showAnchor(f.anchorEl)}else{f.hide()}})}},_initToolbars:function(){var n=this.editor;var q=this.toolbars||[];var h=[];for(var m=0;m<q.length;m++){var o=q[m];var k=new baidu.editor.ui.Toolbar();for(var l=0;l<o.length;l++){var f=o[l];var g=null;if(typeof f=="string"){f=f.toLowerCase();if(f=="|"){f="Separator"}if(baidu.editor.ui[f]){g=new baidu.editor.ui[f](n)}if(f=="fullscreen"){if(h&&h[0]){h[0].items.splice(0,0,g)}else{g&&k.items.splice(0,0,g)}continue}}else{g=f}if(g){k.add(g)}}h[m]=k}this.toolbars=h},getHtmlTpl:function(){return'<div id="##" class="%%"><div id="##_toolbarbox" class="%%-toolbarbox">'+(this.toolbars.length?'<div id="##_toolbarboxouter" class="%%-toolbarboxouter"><div class="%%-toolbarboxinner">'+this.renderToolbarBoxHtml()+"</div></div>":"")+'<div id="##_toolbarmsg" class="%%-toolbarmsg" style="display:none;"><div id = "##_upload_dialog" class="%%-toolbarmsg-upload" onclick="$$.showWordImageDialog();">'+this.editor.getLang("clickToUpload")+'</div><div class="%%-toolbarmsg-close" onclick="$$.hideToolbarMsg();">x</div><div id="##_toolbarmsg_label" class="%%-toolbarmsg-label"></div><div style="height:0;overflow:hidden;clear:both;"></div></div></div><div id="##_iframeholder" class="%%-iframeholder"></div><div id="##_bottombar" class="%%-bottomContainer"><table><tr><td id="##_elementpath" class="%%-bottombar"></td><td id="##_wordcount" class="%%-wordcount"></td></tr></table></div></div>'},showWordImageDialog:function(){this.editor.execCommand("wordimage","word_img");this._dialogs.wordimageDialog.open()},renderToolbarBoxHtml:function(){var g=[];for(var f=0;f<this.toolbars.length;f++){g.push(this.toolbars[f].renderHtml())}return g.join("")},setFullScreen:function(i){if(this._fullscreen!=i){this._fullscreen=i;this.editor.fireEvent("beforefullscreenchange",i);var h=this.editor;if(baidu.editor.browser.gecko){var f=h.selection.getRange().createBookmark()}if(i){this._bakHtmlOverflow=document.documentElement.style.overflow;this._bakBodyOverflow=document.body.style.overflow;this._bakAutoHeight=this.editor.autoHeightEnabled;this._bakScrollTop=Math.max(document.documentElement.scrollTop,document.body.scrollTop);if(this._bakAutoHeight){h.autoHeightEnabled=false;this.editor.disableAutoHeight()}document.documentElement.style.overflow="hidden";document.body.style.overflow="hidden";this._bakCssText=this.getDom().style.cssText;this._bakCssText1=this.getDom("iframeholder").style.cssText;this._updateFullScreen()}else{this.getDom().style.cssText=this._bakCssText;this.getDom("iframeholder").style.cssText=this._bakCssText1;if(this._bakAutoHeight){h.autoHeightEnabled=true;this.editor.enableAutoHeight()}document.documentElement.style.overflow=this._bakHtmlOverflow;document.body.style.overflow=this._bakBodyOverflow;window.scrollTo(0,this._bakScrollTop)}if(baidu.editor.browser.gecko){var g=document.createElement("input");document.body.appendChild(g);h.body.contentEditable=false;setTimeout(function(){g.focus();setTimeout(function(){h.body.contentEditable=true;h.selection.getRange().moveToBookmark(f).select(true);baidu.editor.dom.domUtils.remove(g);i&&window.scroll(0,0)})})}this.editor.fireEvent("fullscreenchanged",i);this.triggerLayout()}},_wordCount:function(){var f=this.getDom("wordcount");if(!this.editor.options.wordCount){f.style.display="none";return}f.innerHTML=this.editor.queryCommandValue("wordcount")},disableWordCount:function(){var f=this.getDom("wordcount");f.innerHTML="";f.style.display="none";this.wordcount=false},enableWordCount:function(){var f=this.getDom("wordcount");f.style.display="";this.wordcount=true;this._wordCount()},_updateFullScreen:function(){if(this._fullscreen){var f=d.getViewportRect();this.getDom().style.cssText="border:0;position:absolute;left:0;top:"+(this.editor.options.topOffset||0)+"px;width:"+f.width+"px;height:"+f.height+"px;z-index:"+(this.getDom().style.zIndex*1+100);d.setViewportOffset(this.getDom(),{left:0,top:this.editor.options.topOffset||0});this.editor.setHeight(f.height-this.getDom("toolbarbox").offsetHeight-this.getDom("bottombar").offsetHeight-(this.editor.options.topOffset||0))}},_updateElementPath:function(){var f=this.getDom("elementpath"),j;if(this.elementPathEnabled&&(j=this.editor.queryCommandValue("elementpath"))){var k=[];for(var h=0,g;g=j[h];h++){k[h]=this.formatHtml('<span unselectable="on" onclick="$$.editor.execCommand(&quot;elementpath&quot;, &quot;'+h+'&quot;);">'+g+"</span>")}f.innerHTML='<div class="edui-editor-breadcrumb" onmousedown="return false;">'+this.editor.getLang("elementPathTip")+": "+k.join(" &gt; ")+"</div>"}else{f.style.display="none"}},disableElementPath:function(){var f=this.getDom("elementpath");f.innerHTML="";f.style.display="none";this.elementPathEnabled=false},enableElementPath:function(){var f=this.getDom("elementpath");f.style.display="";this.elementPathEnabled=true;this._updateElementPath()},isFullScreen:function(){return this._fullscreen},postRender:function(){e.prototype.postRender.call(this);for(var h=0;h<this.toolbars.length;h++){this.toolbars[h].postRender()}var j=this;var g,f=baidu.editor.dom.domUtils,k=function(){clearTimeout(g);g=setTimeout(function(){j._updateFullScreen()})};f.on(window,"resize",k);j.addListener("destroy",function(){f.un(window,"resize",k);clearTimeout(g)})},showToolbarMsg:function(h,g){this.getDom("toolbarmsg_label").innerHTML=h;this.getDom("toolbarmsg").style.display="";if(!g){var f=this.getDom("upload_dialog");f.style.display="none"}},hideToolbarMsg:function(){this.getDom("toolbarmsg").style.display="none"},mapUrl:function(f){return f?f.replace("~/",this.editor.options.UEDITOR_HOME_URL||""):""},triggerLayout:function(){var f=this.getDom();if(f.style.zoom=="1"){f.style.zoom="100%"}else{f.style.zoom="1"}}};b.inherits(c,baidu.editor.ui.UIBase);baidu.editor.ui.Editor=function(f){var h=new baidu.editor.Editor(f);h.options.editor=h;var g=h.render;h.render=function(i){b.domReady(function(){h.langIsReady?j():h.addListener("langReady",j);function j(){h.setOpt({labelMap:h.options.labelMap||UE.I18N[h.options.lang].labelMap});new c(h.options);if(i){if(i.constructor===String){i=document.getElementById(i)}i&&i.getAttribute("name")&&(h.options.textarea=i.getAttribute("name"));if(i&&/script|textarea/ig.test(i.tagName)){var m=document.createElement("div");i.parentNode.insertBefore(m,i);var k=i.value||i.innerHTML;h.options.initialContent=/^[\t\r\n ]*$/.test(k)?h.options.initialContent:k.replace(/>[\n\r\t]+([ ]{4})+/g,">").replace(/[\n\r\t]+([ ]{4})+</g,"<").replace(/>[\n\r\t]+</g,"><");i.id&&(m.id=i.id);i.className&&(m.className=i.className);i.style.cssText&&(m.style.cssText=i.style.cssText);if(/textarea/i.test(i.tagName)){h.textarea=i;h.textarea.style.display="none"}else{i.parentNode.removeChild(i)}i=m;i.innerHTML=""}}h.ui.render(i);var l=h.ui.getDom("iframeholder");h.container=h.ui.getDom();h.container.style.zIndex=h.options.zIndex;g.call(h,l)}})};return h}})();(function(){var c=baidu.editor.utils,d=baidu.editor.ui.Popup,b=baidu.editor.ui.SplitButton,a=baidu.editor.ui.MultiMenuPop=function(e){this.initOptions(e);this.initMultiMenu()};a.prototype={initMultiMenu:function(){var e=this;this.popup=new d({content:"",editor:e.editor,iframe_rendered:false,onshow:function(){if(!this.iframe_rendered){this.iframe_rendered=true;this.getDom("content").innerHTML='<iframe id="'+e.id+'_iframe" src="'+e.iframeUrl+'" frameborder="0"></iframe>';e.editor.container.style.zIndex&&(this.getDom().style.zIndex=e.editor.container.style.zIndex*1+1)}}});this.onbuttonclick=function(){this.showPopup()};this.initSplitButton()}};c.inherits(a,b)})();UE.plugins.basestyle=function(){var d={bold:["strong","b"],italic:["em","i"],subscript:["sub"],superscript:["sup"]},c=function(f,e){var g=f.selection.getStartElementPath();return utils.findNode(g,e)},b=this;for(var a in d){(function(f,e){b.commands[f]={execCommand:function(h){var g=new dom.Range(b.document),n="";if(b.currentSelectedArr&&b.currentSelectedArr.length>0){for(var k=0,j;j=b.currentSelectedArr[k++];){if(j.style.display!="none"){g.selectNodeContents(j).select();!n&&(n=c(this,e));if(h=="superscript"||h=="subscript"){if(!n||n.tagName.toLowerCase()!=h){g.removeInlineStyle(["sub","sup"])}}n?g.removeInlineStyle(e):g.applyInlineStyle(e[0])}}g.selectNodeContents(b.currentSelectedArr[0]).select()}else{g=b.selection.getRange();n=c(this,e);if(g.collapsed){if(n){var m=b.document.createTextNode("");g.insertNode(m).removeInlineStyle(e);g.setStartBefore(m);domUtils.remove(m)}else{var l=g.document.createElement(e[0]);if(h=="superscript"||h=="subscript"){m=b.document.createTextNode("");g.insertNode(m).removeInlineStyle(["sub","sup"]).setStartBefore(m).collapse(true)}g.insertNode(l).setStart(l,0)}g.collapse(true)}else{if(h=="superscript"||h=="subscript"){if(!n||n.tagName.toLowerCase()!=h){g.removeInlineStyle(["sub","sup"])}}n?g.removeInlineStyle(e):g.applyInlineStyle(e[0])}g.select()}return true},queryCommandState:function(){if(this.highlight){return -1}return c(this,e)?1:0}}})(a,d[a])}};UE.plugins.removeformat=function(){var a=this;a.setOpt({removeFormatTags:"b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var",removeFormatAttributes:"class,style,lang,width,height,align,hspace,valign"});a.commands.removeformat={execCommand:function(o,s,b,m,n){var h=new RegExp("^(?:"+(s||this.options.removeFormatTags).replace(/,/g,"|")+")$","i"),f=b?[]:(m||this.options.removeFormatAttributes).split(","),j=new dom.Range(this.document),k,e,l,c=function(i){return i.nodeType==1};function d(w){if(w.nodeType==3||w.tagName.toLowerCase()!="span"){return 0}if(browser.ie){var u=w.attributes;if(u.length){for(var v=0,t=u.length;v<t;v++){if(u[v].specified){return 0}}return 1}}return !w.attributes.length}function q(y){var i=y.createBookmark();if(y.collapsed){y.enlarge(true)}if(!n){var t=domUtils.findParentByTagName(y.startContainer,"a",true);if(t){y.setStartBefore(t)}t=domUtils.findParentByTagName(y.endContainer,"a",true);if(t){y.setEndAfter(t)}}k=y.createBookmark();u=k.start;while((l=u.parentNode)&&!domUtils.isBlockElm(l)){domUtils.breakParent(u,l);domUtils.clearEmptySibling(u)}if(k.end){u=k.end;while((l=u.parentNode)&&!domUtils.isBlockElm(l)){domUtils.breakParent(u,l);domUtils.clearEmptySibling(u)}var z=domUtils.getNextDomNode(k.start,false,c),x;while(z){if(z==k.end){break}x=domUtils.getNextDomNode(z,true,c);if(!dtd.$empty[z.tagName.toLowerCase()]&&!domUtils.isBookmarkNode(z)){if(h.test(z.tagName)){if(b){domUtils.removeStyle(z,b);if(d(z)&&b!="text-decoration"){domUtils.remove(z,true)}}else{domUtils.remove(z,true)}}else{if(!dtd.$tableContent[z.tagName]&&!dtd.$list[z.tagName]){domUtils.removeAttributes(z,f);if(d(z)){domUtils.remove(z,true)}}}}z=x}}var A=k.start.parentNode;if(domUtils.isBlockElm(A)&&!dtd.$tableContent[A.tagName]&&!dtd.$list[A.tagName]){domUtils.removeAttributes(A,f)}A=k.end.parentNode;if(k.end&&domUtils.isBlockElm(A)&&!dtd.$tableContent[A.tagName]&&!dtd.$list[A.tagName]){domUtils.removeAttributes(A,f)}y.moveToBookmark(k).moveToBookmark(i);var u=y.startContainer,w,v=y.collapsed;while(u.nodeType==1&&domUtils.isEmptyNode(u)&&dtd.$removeEmpty[u.tagName]){w=u.parentNode;y.setStartBefore(u);if(y.startContainer===y.endContainer){y.endOffset--}domUtils.remove(u);u=w}if(!v){u=y.endContainer;while(u.nodeType==1&&domUtils.isEmptyNode(u)&&dtd.$removeEmpty[u.tagName]){w=u.parentNode;y.setEndBefore(u);domUtils.remove(u);u=w}}}if(this.currentSelectedArr&&this.currentSelectedArr.length){for(var g=0,r;r=this.currentSelectedArr[g++];){j.selectNodeContents(r);q(j)}j.selectNodeContents(this.currentSelectedArr[0]).select()}else{j=this.selection.getRange();q(j);j.select()}},queryCommandState:function(){return this.highlight?-1:0}}};UE.plugins.font=function(){var a=this,c={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family",underline:"text-decoration",strikethrough:"text-decoration"};a.setOpt({fontfamily:[{name:"songti",val:"\u5b8b\u4f53,SimSun"},{name:"yahei",val:"\u5fae\u8f6f\u96c5\u9ed1,Microsoft YaHei"},{name:"kaiti",val:"\u6977\u4f53,\u6977\u4f53_GB2312, SimKai"},{name:"heiti",val:"\u9ed1\u4f53, SimHei"},{name:"lishu",val:"\u96b6\u4e66, SimLi"},{name:"andaleMono",val:"andale mono"},{name:"arial",val:"arial, helvetica,sans-serif"},{name:"arialBlack",val:"arial black,avant garde"},{name:"comicSansMs",val:"comic sans ms"},{name:"impact",val:"impact,chicago"},{name:"timesNewRoman",val:"times new roman"}],fontsize:[10,11,12,14,16,18,20,24,36]});for(var b in c){(function(e,d){UE.commands[e]={execCommand:function(m,j){j=j||(this.queryCommandState(m)?"none":m=="underline"?"underline":"line-through");var h=this,g=this.selection.getRange(),l;if(j=="default"){if(g.collapsed){l=h.document.createTextNode("font");g.insertNode(l).select()}h.execCommand("removeFormat","span,a",d);if(l){g.setStartBefore(l).setCursor();domUtils.remove(l)}}else{if(h.currentSelectedArr&&h.currentSelectedArr.length>0){for(var f=0,o;o=h.currentSelectedArr[f++];){g.selectNodeContents(o);g.applyInlineStyle("span",{style:d+":"+j})}g.selectNodeContents(this.currentSelectedArr[0]).select()}else{if(!g.collapsed){if((e=="underline"||e=="strikethrough")&&h.queryCommandValue(e)){h.execCommand("removeFormat","span,a",d)}g=h.selection.getRange();g.applyInlineStyle("span",{style:d+":"+j}).select()}else{var k=domUtils.findParentByTagName(g.startContainer,"span",true);l=h.document.createTextNode("font");if(k&&!k.children.length&&!k[browser.ie?"innerText":"textContent"].replace(fillCharReg,"").length){g.insertNode(l);if(e=="underline"||e=="strikethrough"){g.selectNode(l).select();h.execCommand("removeFormat","span,a",d,null);k=domUtils.findParentByTagName(l,"span",true);g.setStartBefore(l)}k.style.cssText+=";"+d+":"+j;g.collapse(true).select()}else{g.insertNode(l);g.selectNode(l).select();k=g.document.createElement("span");if(e=="underline"||e=="strikethrough"){if(domUtils.findParentByTagName(l,"a",true)){g.setStartBefore(l).setCursor();domUtils.remove(l);return}h.execCommand("removeFormat","span,a",d)}k.style.cssText=d+":"+j;l.parentNode.insertBefore(k,l);if(!browser.ie||browser.ie&&browser.version==9){var n=k.parentNode;while(!domUtils.isBlockElm(n)){if(n.tagName=="SPAN"){k.style.cssText=n.style.cssText+";"+k.style.cssText}n=n.parentNode}}if(opera){setTimeout(function(){g.setStart(k,0).setCursor()})}else{g.setStart(k,0).setCursor()}}domUtils.remove(l)}}}return true},queryCommandValue:function(g){var f=this.selection.getStart();if(g=="underline"||g=="strikethrough"){var h=f,i;while(h&&!domUtils.isBlockElm(h)&&!domUtils.isBody(h)){if(h.nodeType==1){i=domUtils.getComputedStyle(h,d);if(i!="none"){return i}}h=h.parentNode}return"none"}return domUtils.getComputedStyle(f,d)},queryCommandState:function(f){if(this.highlight){return -1}if(!(f=="underline"||f=="strikethrough")){return 0}return this.queryCommandValue(f)==(f=="underline"?"underline":"line-through")}}})(b,c[b])}};(function(){var c=domUtils.isBlockElm,b={left:1,right:1,center:1,justify:1},a=function(g,d){var j=g.createBookmark(),m=function(o){return o.nodeType==1?o.tagName.toLowerCase()!="br"&&!domUtils.isBookmarkNode(o):!domUtils.isWhitespace(o)};g.enlarge(true);var n=g.createBookmark(),i=domUtils.getNextDomNode(n.start,false,m),k=g.cloneRange(),f;while(i&&!(domUtils.getPosition(i,n.end)&domUtils.POSITION_FOLLOWING)){if(i.nodeType==3||!c(i)){k.setStartBefore(i);while(i&&i!==n.end&&!c(i)){f=i;i=domUtils.getNextDomNode(i,false,null,function(o){return !c(o)})}k.setEndAfter(f);var h=k.getCommonAncestor();if(!domUtils.isBody(h)&&c(h)){domUtils.setStyles(h,utils.isString(d)?{"text-align":d}:d);i=h}else{var e=g.document.createElement("p");domUtils.setStyles(e,utils.isString(d)?{"text-align":d}:d);var l=k.extractContents();e.appendChild(l);k.insertNode(e);i=e}i=domUtils.getNextDomNode(i,false,m)}else{i=domUtils.getNextDomNode(i,true,m)}}return g.moveToBookmark(n).moveToBookmark(j)};UE.commands.justify={execCommand:function(f,j){var e=this.selection.getRange(),d;if(this.currentSelectedArr&&this.currentSelectedArr.length>0){for(var g=0,h;h=this.currentSelectedArr[g++];){if(domUtils.isEmptyNode(h)){d=this.document.createTextNode("p");e.setStart(h,0).collapse(true).insertNode(d).selectNode(d)}else{e.selectNodeContents(h)}a(e,j.toLowerCase());d&&domUtils.remove(d)}e.selectNode(this.currentSelectedArr[0]).select()}else{if(e.collapsed){d=this.document.createTextNode("p");e.insertNode(d)}a(e,j);if(d){e.setStartBefore(d).collapse(true);domUtils.remove(d)}e.select()}return true},queryCommandValue:function(){var d=this.selection.getStart(),e=domUtils.getComputedStyle(d,"text-align");return b[e]?e:"left"},queryCommandState:function(){return this.highlight?-1:0}}})();(function(){function a(d){var e=d.startContainer,c=d.endContainer;if(e=domUtils.findParentByTagName(e,"a",true)){d.setStartBefore(e)}if(c=domUtils.findParentByTagName(c,"a",true)){d.setEndAfter(c)}}UE.commands.unlink={execCommand:function(){var c,d=new dom.Range(this.document),k=this.currentSelectedArr,h;if(k&&k.length>0){for(var f=0,g;g=k[f++];){c=domUtils.getElementsByTagName(g,"a");for(var e=0,l;l=c[e++];){domUtils.remove(l,true)}}if(domUtils.isEmptyNode(k[0])){d.setStart(k[0],0).setCursor()}else{d.selectNodeContents(k[0]).select()}}else{d=this.selection.getRange();if(d.collapsed&&!domUtils.findParentByTagName(d.startContainer,"a",true)){return}h=d.createBookmark();a(d);d.removeInlineStyle("a").moveToBookmark(h).select()}},queryCommandState:function(){return !this.highlight&&this.queryCommandValue("link")?0:-1}};function b(d,e){a(d=d.adjustmentBoundary());var g=d.startContainer;if(g.nodeType==1){g=g.childNodes[d.startOffset];if(g&&g.nodeType==1&&g.tagName=="A"&&/^(?:https?|ftp|file)\s*:\s*\/\//.test(g[browser.ie?"innerText":"textContent"])){g[browser.ie?"innerText":"textContent"]=utils.html(e.textValue||e.href)}}d.removeInlineStyle("a");if(d.collapsed){var c=d.document.createElement("a"),f="";if(e.textValue){f=utils.html(e.textValue);delete e.textValue}else{f=utils.html(e.href)}domUtils.setAttributes(c,e);d.insertNode(c);c[browser.ie?"innerText":"textContent"]=f;d.selectNode(c)}else{d.applyInlineStyle("a",e)}}UE.commands.link={queryCommandState:function(){return this.highlight?-1:0},execCommand:function(d,f){var c=new dom.Range(this.document),h=this.currentSelectedArr;f.data_ue_src&&(f.data_ue_src=utils.unhtml(f.data_ue_src,/[<">]/g));f.href&&(f.href=utils.unhtml(f.href,/[<">]/g));f.textValue&&(f.textValue=utils.unhtml(f.textValue,/[<">]/g));if(h&&h.length){for(var e=0,g;g=h[e++];){if(domUtils.isEmptyNode(g)){g[browser.ie?"innerText":"textContent"]=utils.html(f.textValue||f.href)}b(c.selectNodeContents(g),f)}c.selectNodeContents(h[0]).select()}else{b(c=this.selection.getRange(),f);c.collapse().select(true)}},queryCommandValue:function(){var l=new dom.Range(this.document),j=this.currentSelectedArr,g,f;if(j&&j.length){for(var k=0,d;d=j[k++];){g=d.getElementsByTagName("a");if(g[0]){return g[0]}}}else{l=this.selection.getRange();if(l.collapsed){f=this.selection.getStart();if(f&&(f=domUtils.findParentByTagName(f,"a",true))){return f}}else{l.shrinkBoundary();var e=l.startContainer.nodeType==3||!l.startContainer.childNodes[l.startOffset]?l.startContainer:l.startContainer.childNodes[l.startOffset],h=l.endContainer.nodeType==3||l.endOffset==0?l.endContainer:l.endContainer.childNodes[l.endOffset-1],m=l.getCommonAncestor();f=domUtils.findParentByTagName(m,"a",true);if(!f&&m.nodeType==1){var g=m.getElementsByTagName("a"),c,n;for(var k=0,o;o=g[k++];){c=domUtils.getPosition(o,e),n=domUtils.getPosition(o,h);if((c&domUtils.POSITION_FOLLOWING||c&domUtils.POSITION_CONTAINS)&&(n&domUtils.POSITION_PRECEDING||n&domUtils.POSITION_CONTAINS)){f=o;break}}}return f}}}}})();UE.commands.gmap=UE.commands.map={queryCommandState:function(){return this.highlight?-1:0}};UE.plugins.catchremoteimage=function(){if(this.options.catchRemoteImageEnable===false){return}var me=this;this.setOpt({localDomain:["127.0.0.1","localhost","img.baidu.com"],separater:"ue_separate_ue",catchFieldName:"upfile",catchRemoteImageEnable:true});var ajax=UE.ajax,localDomain=me.options.localDomain,catcherUrl=me.options.catcherUrl,separater=me.options.separater;function catchremoteimage(imgs,callbacks){var submitStr=imgs.join(separater);var tmpOption={timeout:60000,onsuccess:callbacks.success,onerror:callbacks.error};tmpOption[me.options.catchFieldName]=submitStr;ajax.request(catcherUrl,tmpOption)}me.addListener("afterpaste",function(){me.fireEvent("catchRemoteImage")});me.addListener("catchRemoteImage",function(){var remoteImages=[];var imgs=domUtils.getElementsByTagName(me.document,"img");var test=function(src,urls){for(var j=0,url;url=urls[j++];){if(src.indexOf(url)!==-1){return true}}return false};for(var i=0,ci;ci=imgs[i++];){if(ci.getAttribute("word_img")){continue}var src=ci.getAttribute("data_ue_src")||ci.src||"";if(/^(https?|ftp):/i.test(src)&&!test(src,localDomain)){remoteImages.push(src)}}if(remoteImages.length){catchremoteimage(remoteImages,{success:function(xhr){try{var info=eval("("+xhr.responseText+")")}catch(e){return}var srcUrls=info.srcUrl.split(separater),urls=info.url.split(separater);for(var i=0,ci;ci=imgs[i++];){var src=ci.getAttribute("data_ue_src")||ci.src||"";for(var j=0,cj;cj=srcUrls[j++];){var url=urls[j-1];if(src==cj&&url!="error"){var newSrc=me.options.catcherPath+url;domUtils.setAttributes(ci,{src:newSrc,data_ue_src:newSrc});break}}}},error:function(){me.fireEvent("catchremoteerror")}})}})};UE.commands.imagefloat={execCommand:function(a,g){var i=this,f=i.selection.getRange();if(!f.collapsed){var d=f.getClosedNode();if(d&&d.tagName=="IMG"){switch(g){case"left":case"right":case"none":var h=d.parentNode,b,c,e;while(dtd.$inline[h.tagName]||h.tagName=="A"){h=h.parentNode}b=h;if(b.tagName=="P"&&domUtils.getStyle(b,"text-align")=="center"){if(!domUtils.isBody(b)&&domUtils.getChildCount(b,function(j){return !domUtils.isBr(j)&&!domUtils.isWhitespace(j)})==1){c=b.previousSibling;e=b.nextSibling;if(c&&e&&c.nodeType==1&&e.nodeType==1&&c.tagName==e.tagName&&domUtils.isBlockElm(c)){c.appendChild(b.firstChild);while(e.firstChild){c.appendChild(e.firstChild)}domUtils.remove(b);domUtils.remove(e)}else{domUtils.setStyle(b,"text-align","")}}f.selectNode(d).select()}domUtils.setStyle(d,"float",g);break;case"center":if(i.queryCommandValue("imagefloat")!="center"){h=d.parentNode;domUtils.setStyle(d,"float","none");b=d;while(h&&domUtils.getChildCount(h,function(j){return !domUtils.isBr(j)&&!domUtils.isWhitespace(j)})==1&&(dtd.$inline[h.tagName]||h.tagName=="A")){b=h;h=h.parentNode}f.setStartBefore(b).setCursor(false);h=i.document.createElement("div");h.appendChild(b);domUtils.setStyle(b,"float","");i.execCommand("insertHtml",'<p id="_img_parent_tmp" style="text-align:center">'+h.innerHTML+"</p>");b=i.document.getElementById("_img_parent_tmp");b.removeAttribute("id");b=b.firstChild;f.selectNode(b).select();e=b.parentNode.nextSibling;if(e&&domUtils.isEmptyNode(e)){domUtils.remove(e)}}break}}}},queryCommandValue:function(){var a=this.selection.getRange(),b,c;if(a.collapsed){return"none"}b=a.getClosedNode();if(b&&b.nodeType==1&&b.tagName=="IMG"){c=domUtils.getComputedStyle(b,"float");if(c=="none"){c=domUtils.getComputedStyle(b.parentNode,"text-align")=="center"?"center":c}return{left:1,right:1,center:1}[c]?c:"none"}return"none"},queryCommandState:function(){if(this.highlight){return -1}var a=this.selection.getRange(),b;if(a.collapsed){return -1}b=a.getClosedNode();if(b&&b.nodeType==1&&b.tagName=="IMG"){return 0}return -1}};UE.commands.insertimage={execCommand:function(b,a){a=utils.isArray(a)?a:[a];if(!a.length){return}var j=this,g=j.selection.getRange(),d=g.getClosedNode();if(d&&/img/i.test(d.tagName)&&d.className!="edui-faked-video"&&!d.getAttribute("word_img")){var e=a.shift();var k=e.floatStyle;delete e.floatStyle;domUtils.setAttributes(d,e);j.execCommand("imagefloat",k);if(a.length>0){g.setStartAfter(d).setCursor(false,true);j.execCommand("insertimage",a)}}else{var f=[],h="",l;l=a[0];if(a.length==1){h='<img src="'+l.src+'" '+(l.data_ue_src?' data_ue_src="'+l.data_ue_src+'" ':"")+(l.width?'width="'+l.width+'" ':"")+(l.height?' height="'+l.height+'" ':"")+(l.floatStyle=="left"||l.floatStyle=="right"?' style="float:'+l.floatStyle+';"':"")+(l.title&&l.title!=""?' title="'+l.title+'"':"")+(l.border&&l.border!="0"?' border="'+l.border+'"':"")+(l.alt&&l.alt!=""?' alt="'+l.alt+'"':"")+(l.hspace&&l.hspace!="0"?' hspace = "'+l.hspace+'"':"")+(l.vspace&&l.vspace!="0"?' vspace = "'+l.vspace+'"':"")+"/>";if(l.floatStyle=="center"){h='<p style="text-align: center">'+h+"</p>"}f.push(h)}else{for(var c=0;l=a[c++];){h="<p "+(l.floatStyle=="center"?'style="text-align: center" ':"")+'><img src="'+l.src+'" '+(l.width?'width="'+l.width+'" ':"")+(l.data_ue_src?' data_ue_src="'+l.data_ue_src+'" ':"")+(l.height?' height="'+l.height+'" ':"")+' style="'+(l.floatStyle&&l.floatStyle!="center"?"float:"+l.floatStyle+";":"")+(l.border||"")+'" '+(l.title?' title="'+l.title+'"':"")+" /></p>";f.push(h)}}j.execCommand("insertHtml",f.join(""))}},queryCommandState:function(){return this.highlight?-1:0}};UE.plugins.video=function(){var c=this,d;function b(f,h,e,j,g,i){return !g?(i?("<p "+(j!="none"?(j=="center"?' style="text-align:center;" ':' style="float:"'+j):"")+">"):"")+'<img align="'+j+'" width="'+h+'" height="'+e+'" _url="'+f+'" class="edui-faked-video" src="'+c.options.UEDITOR_HOME_URL+'themes/default/images/spacer.gif" style="background:url('+c.options.UEDITOR_HOME_URL+'themes/default/images/videologo.gif) no-repeat center center; border:1px solid gray;" />'+(i?"</p>":""):'<embed type="application/x-shockwave-flash" class="edui-faked-video" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+f+'" width="'+h+'" height="'+e+'" align="'+j+'"'+(j!="none"?' style= "'+(j=="center"?"display:block;":" float: "+j)+'"':"")+' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >'}function a(j){var g,e=domUtils.getElementsByTagName(c.document,!j?"embed":"img");for(var f=0,h;h=e[f++];){if(h.className!="edui-faked-video"){continue}g=c.document.createElement("div");var k=h.style.cssFloat;g.innerHTML=b(j?h.getAttribute("_url"):h.getAttribute("src"),h.width,h.height,k||h.getAttribute("align"),j);h.parentNode.replaceChild(g.firstChild,h)}}c.addListener("beforegetcontent",function(){a(true)});c.addListener("aftersetcontent",function(){a(false)});c.addListener("aftergetcontent",function(e){if(e=="aftergetcontent"&&c.queryCommandState("source")){return}a(false)});c.commands.insertvideo={execCommand:function(h,k){k=utils.isArray(k)?k:[k];var g=[];for(var f=0,j,e=k.length;f<e;f++){j=k[f];g.push(b(j.url,j.width||420,j.height||280,j.align||"none",false,true))}c.execCommand("inserthtml",g.join(""))},queryCommandState:function(){var f=c.selection.getRange().getClosedNode(),e=f&&(f.className=="edui-faked-video");return this.highlight?-1:(e?1:0)}}};UE.plugins.highlight=function(){var b=this;if(!/highlightcode/i.test(b.options.toolbars.join(""))){return}b.commands.highlightcode={execCommand:function(m,g,i){if(g&&i){var h=document.createElement("pre");h.className="brush: "+i+";toolbar:false;";h.style.display="";h.appendChild(document.createTextNode(g));document.body.appendChild(h);if(b.queryCommandState("highlightcode")){b.execCommand("highlightcode")}b.execCommand("inserthtml",SyntaxHighlighter.highlight(h,null,true),true);var d=b.document.getElementById(SyntaxHighlighter.getHighlighterDivId());d.setAttribute("highlighter",h.className);domUtils.remove(h);c()}else{var k=this.selection.getRange(),f=domUtils.findParentByTagName(k.startContainer,"table",true),j=domUtils.findParentByTagName(k.endContainer,"table",true),l;if(f&&j&&f===j&&f.parentNode.className.indexOf("syntaxhighlighter")>-1){l=f.parentNode;if(domUtils.isBody(l.parentNode)){var e=b.document.createElement("p");e.innerHTML=browser.ie?"":"<br/>";b.body.insertBefore(e,l);k.setStart(e,0)}else{k.setStartBefore(l)}k.setCursor();domUtils.remove(l)}}},queryCommandState:function(){var e=this.selection.getRange(),f,d;e.adjustmentBoundary();f=domUtils.findParent(e.startContainer,function(g){return g.nodeType==1&&g.tagName=="DIV"&&domUtils.hasClass(g,"syntaxhighlighter")},true);d=domUtils.findParent(e.endContainer,function(g){return g.nodeType==1&&g.tagName=="DIV"&&domUtils.hasClass(g,"syntaxhighlighter")},true);return f&&d&&f==d?1:0}};b.addListener("beforeselectionchange",function(){b.highlight=b.queryCommandState("highlightcode")});b.addListener("afterselectionchange",function(){b.highlight=0});b.addListener("ready",function(){if(typeof XRegExp=="undefined"){var d={id:"syntaxhighlighter_js",src:b.options.highlightJsUrl||b.options.UEDITOR_HOME_URL+"third-party/SyntaxHighlighter/shCore.js",tag:"script",type:"text/javascript",defer:"defer"};utils.loadFile(document,d,function(){a()})}if(!b.document.getElementById("syntaxhighlighter_css")){var d={id:"syntaxhighlighter_css",tag:"link",rel:"stylesheet",type:"text/css",href:b.options.highlightCssUrl||b.options.UEDITOR_HOME_URL+"third-party/SyntaxHighlighter/shCoreDefault.css"};utils.loadFile(b.document,d)}});b.addListener("beforegetcontent",function(l,d){for(var f=0,g,m=domUtils.getElementsByTagName(b.body,"div");g=m[f++];){if(g.className=="container"){var h=g.parentNode;while(h){if(h.tagName=="DIV"&&/highlighter/.test(h.id)){break}h=h.parentNode}if(!h){return}var e=b.document.createElement("pre");for(var k=[],j=0,n;n=g.childNodes[j++];){k.push(n[browser.ie?"innerText":"textContent"])}e.appendChild(b.document.createTextNode(k.join("\n")));e.className=h.getAttribute("highlighter");h.parentNode.insertBefore(e,h);domUtils.remove(h)}}});b.addListener("aftergetcontent",function(d,e){a()});function c(){setTimeout(function(){var h=b.document.getElementById(SyntaxHighlighter.getHighlighterDivId());if(h){var g=h.getElementsByTagName("td");for(var f=0,d,e;d=g[0].childNodes[f];f++){e=g[1].firstChild.childNodes[f];if(e){e.style.height=d.style.height=e.offsetHeight+"px"}}}})}function a(){for(var f=0,l,j=domUtils.getElementsByTagName(b.document,"pre");l=j[f++];){if(l.className.indexOf("brush")>-1){var h=document.createElement("pre"),d,k;h.className=l.className;h.style.display="none";h.appendChild(document.createTextNode(l[browser.ie?"innerText":"textContent"]));document.body.appendChild(h);try{d=SyntaxHighlighter.highlight(h,null,true)}catch(g){domUtils.remove(h);return}k=b.document.createElement("div");k.innerHTML=d;k.firstChild.setAttribute("highlighter",h.className);l.parentNode.insertBefore(k.firstChild,l);domUtils.remove(h);domUtils.remove(l);c()}}}b.addListener("aftersetcontent",function(){a()});b.addListener("fullscreenchanged",function(){var l=domUtils.getElementsByTagName(b.document,"div");for(var f=0,k;k=l[f++];){if(/^highlighter/.test(k.id)){var h=k.getElementsByTagName("td");for(var g=0,d,e;d=h[0].childNodes[g];g++){e=h[1].firstChild.childNodes[g];e.style.height=d.style.height=e.offsetHeight+"px"}}}})};(function(){function c(f){f=f||{};this.indentChar=f.indentChar||"    ";this.breakChar=f.breakChar||"\n";this.selfClosingEnd=f.selfClosingEnd||" />"}var e=function(){var g={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function f(h){return g[h]}return function(h){h=h+"";return h?h.replace(/[<>"']/g,f):""}}();var d=utils.extend({a:1,A:1},dtd.$inline,true);function b(g){var h=[];for(var f in g){h.push(f+'="'+e(g[f])+'"')}return h.join(" ")}c.prototype={format:function(f){var g=UE.serialize.parseHTML(f);this.buff=[];this.indents="";this.indenting=1;this.visitNode(g);return this.buff.join("")},visitNode:function(g){if(g.type=="fragment"){this.visitChildren(g.children)}else{if(g.type=="element"){var f=dtd.$empty[g.tag];this.visitTag(g.tag,g.attributes,f);this.visitChildren(g.children);if(!f){this.visitEndTag(g.tag)}}else{if(g.type=="comment"){this.visitComment(g.data)}else{this.visitText(g.data,dtd.$notTransContent[g.parent.tag])}}}},visitChildren:function(g){for(var f=0;f<g.length;f++){this.visitNode(g[f])}},visitTag:function(f,h,g){if(this.indenting){this.indent()}else{if(!d[f]){this.newline();this.indent()}}this.buff.push("<",f);var i=b(h);if(i){this.buff.push(" ",i)}if(g){this.buff.push(this.selfClosingEnd);if(f=="br"){this.newline()}}else{this.buff.push(">");this.indents+=this.indentChar}if(!d[f]){this.newline()}},indent:function(){this.buff.push(this.indents);this.indenting=0},newline:function(){this.buff.push(this.breakChar);this.indenting=1},visitEndTag:function(f){this.indents=this.indents.slice(0,-this.indentChar.length);if(this.indenting){this.indent()}else{if(!d[f]){this.newline();this.indent()}}this.buff.push("</",f,">")},visitText:function(g,f){if(this.indenting){this.indent()}g=g.replace(/&nbsp;/g," ");this.buff.push(g)},visitComment:function(f){if(this.indenting){this.indent()}this.buff.push("<!--",f,"-->")}};var a={textarea:function(h,g){var f=g.ownerDocument.createElement("textarea");f.style.cssText="position:absolute;resize:none;width:100%;height:100%;border:0;padding:0;margin:0;overflow-y:auto;";if(browser.ie&&browser.version<8){f.style.width=g.offsetWidth+"px";f.style.height=g.offsetHeight+"px";g.onresize=function(){f.style.width=g.offsetWidth+"px";f.style.height=g.offsetHeight+"px"}}g.appendChild(f);return{setContent:function(i){f.value=i},getContent:function(){return f.value},select:function(){var i;if(browser.ie){i=f.createTextRange();i.collapse(true);i.select()}else{f.setSelectionRange(0,0);f.focus()}},dispose:function(){g.removeChild(f);g.onresize=null;f=null;g=null}}},codemirror:function(i,h){var g={mode:"text/html",tabMode:"indent",lineNumbers:true,lineWrapping:true};var f=window.CodeMirror(h,g);var j=f.getWrapperElement();j.style.cssText='position:absolute;left:0;top:0;width:100%;height:100%;font-family:consolas,"Courier new",monospace;font-size:13px;';f.getScrollerElement().style.cssText="position:absolute;left:0;top:0;width:100%;height:100%;";f.refresh();return{setContent:function(k){f.setValue(k)},getContent:function(){return f.getValue()},select:function(){f.focus()},dispose:function(){h.removeChild(j);j=null;f=null}}}};UE.plugins.source=function(){var j=this;var f=this.options;var l=new c(f.source);var i=false;var m;f.sourceEditor=f.sourceEditor||"codemirror";j.setOpt({sourceEditorFirst:false});function g(o){return a[f.sourceEditor=="codemirror"&&window.CodeMirror?"codemirror":"textarea"](j,o)}var n;j.commands.source={execCommand:function(){i=!i;if(i){j.undoManger&&j.undoManger.save();this.currentSelectedArr&&domUtils.clearSelectedArr(this.currentSelectedArr);if(browser.gecko){j.body.contentEditable=false}n=j.iframe.style.cssText;j.iframe.style.cssText+="position:absolute;left:-32768px;top:-32768px;";var q=l.format(j.hasContents()?j.getContent():"");m=g(j.iframe.parentNode);m.setContent(q);setTimeout(function(){m.select()})}else{j.iframe.style.cssText=n;var o=m.getContent()||"<p>"+(browser.ie?"":"<br/>")+"</p>";o=o.replace(/>[\n\r\t]+([ ]{4})+/g,">").replace(/[\n\r\t]+([ ]{4})+</g,"<").replace(/>[\n\r\t]+</g,"><");j.setContent(o);m.dispose();m=null;setTimeout(function(){var t=j.body.firstChild;if(!t){j.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>";t=j.body.firstChild}j.undoManger&&j.undoManger.save();while(t&&t.firstChild){t=t.firstChild}var s=j.selection.getRange();if(t.nodeType==3||dtd.$empty[t.tagName]){s.setStartBefore(t)}else{s.setStart(t,0)}if(browser.gecko){var r=document.createElement("input");r.style.cssText="position:absolute;left:0;top:-32768px";document.body.appendChild(r);j.body.contentEditable=false;setTimeout(function(){domUtils.setViewportOffset(r,{left:-32768,top:0});r.focus();setTimeout(function(){j.body.contentEditable=true;s.setCursor(false,true);domUtils.remove(r)})})}else{s.setCursor(false,true)}})}this.fireEvent("sourcemodechanged",i)},queryCommandState:function(){return i|0},notNeedUndo:1};var h=j.queryCommandState;j.queryCommandState=function(o){o=o.toLowerCase();if(i){return o=="source"?1:-1}return h.apply(this,arguments)};var k=j.getContent;j.getContent=function(){if(i&&m){var o=m.getContent();if(this.serialize){var q=this.serialize.parseHTML(o);q=this.serialize.filter(q);o=this.serialize.toHTML(q)}return o}else{return k.apply(this,arguments)}};if(f.sourceEditor=="codemirror"){j.addListener("ready",function(){utils.loadFile(document,{src:f.codeMirrorJsUrl||f.UEDITOR_HOME_URL+"third-party/codemirror2.15/codemirror.js",tag:"script",type:"text/javascript",defer:"defer"},function(){if(f.sourceEditorFirst){setTimeout(function(){j.execCommand("source")},0)}});utils.loadFile(document,{tag:"link",rel:"stylesheet",type:"text/css",href:f.codeMirrorCssUrl||f.UEDITOR_HOME_URL+"third-party/codemirror2.15/codemirror.css"})})}}})();UE.plugins.wordcount=function(){var d=this;d.setOpt({wordCount:true,maximumWords:10000,wordCountMsg:d.options.wordCountMsg||d.getLang("wordCountMsg"),wordOverFlowMsg:d.options.wordOverFlowMsg||d.getLang("wordOverFlowMsg")});var b=d.options,a=b.maximumWords,e=b.wordCountMsg,c=b.wordOverFlowMsg;if(!b.wordCount){return}d.commands.wordcount={queryCommandValue:function(j,h){var i,f,g;if(h){g=new RegExp("[\r\t\n]","g");f=this.getContentTxt().replace(g,"");return f.length}g=new RegExp("[\r\t\n]","g");f=this.getContentTxt().replace(g,"");i=f.length;if(a-i<0){d.fireEvent("wordcountoverflow");return c}return e.replace("{#leave}",a-i>=0?a-i:0).replace("{#count}",i)}}};UE.plugins.contextmenu=function(){var c=this,e=c.getLang("contextMenu"),d,a=c.options.contextMenu||[{label:e["delete"],cmdName:"delete"},{label:e.selectall,cmdName:"selectall"},{label:e.deletecode,cmdName:"highlightcode",icon:"deletehighlightcode"},{label:e.cleardoc,cmdName:"cleardoc",exec:function(){if(confirm(e.confirmclear)){this.execCommand("cleardoc")}}},"-",{label:e.unlink,cmdName:"unlink"},"-",{group:e.paragraph,icon:"justifyjustify",subMenu:[{label:c.getLang("justifyleft"),cmdName:"justify",value:"left"},{label:c.getLang("justifyright"),cmdName:"justify",value:"right"},{label:c.getLang("justifyrenter"),cmdName:"justify",value:"center"},{label:c.getLang("justify"),cmdName:"justify",value:"justify"}]},"-",{label:e.edittable,cmdName:"edittable",exec:function(){this.ui._dialogs.inserttableDialog.open()}},{label:e.edittd,cmdName:"edittd",exec:function(){if(UE.ui.edittd){new UE.ui.edittd(this)}this.ui._dialogs.edittdDialog.open()}},{group:e.table,icon:"table",subMenu:[{label:e.deletetable,cmdName:"deletetable"},{label:e.insertparagraphbeforetable,cmdName:"insertparagraphbeforetable"},"-",{label:e.deleterow,cmdName:"deleterow"},{label:e.deletecol,cmdName:"deletecol"},"-",{label:e.insertrow,cmdName:"insertrow"},{label:e.insertcol,cmdName:"insertcol"},"-",{label:e.mergeright,cmdName:"mergeright"},{label:e.mergedown,cmdName:"mergedown"},"-",{label:e.splittorows,cmdName:"splittorows"},{label:e.splittocols,cmdName:"splittocols"},{label:e.mergecells,cmdName:"mergecells"},{label:e.splittocells,cmdName:"splittocells"}]},{label:e.copy,cmdName:"copy",exec:function(){alert(e.copymsg)},query:function(){return 0}},{label:e.paste,cmdName:"paste",exec:function(){alert(e.pastemsg)},query:function(){return 0}}];if(!a.length){return}var b=UE.ui.uiUtils;c.addListener("contextmenu",function(m,o){var h=b.getViewportOffsetByEvent(o);c.fireEvent("beforeselectionchange");if(d){d.destroy()}for(var j=0,f,q=[];f=a[j];j++){var n;(function(t){if(t=="-"){if((n=q[q.length-1])&&n!=="-"){q.push("-")}}else{if(t.hasOwnProperty("group")){for(var s=0,r,i=[];r=t.subMenu[s];s++){(function(u){if(u=="-"){if((n=i[i.length-1])&&n!=="-"){i.push("-")}}else{if((c.commands[u.cmdName]||UE.commands[u.cmdName]||u.query)&&(u.query?u.query():c.queryCommandState(u.cmdName))>-1){i.push({label:u.label||c.getLang("contextMenu."+u.cmdName+(u.value||"")),className:"edui-for-"+u.cmdName+(u.value||""),onclick:u.exec?function(){u.exec.call(c)}:function(){c.execCommand(u.cmdName,u.value)}})}}})(r)}if(i.length){q.push({label:t.icon=="table"?c.getLang("contextMenu.table"):c.getLang("contextMenu.paragraph"),className:"edui-for-"+t.icon,subMenu:{items:i,editor:c}})}}else{if((c.commands[t.cmdName]||UE.commands[t.cmdName]||t.query)&&(t.query?t.query():c.queryCommandState(t.cmdName))>-1){if(t.cmdName=="highlightcode"&&c.queryCommandState(t.cmdName)==0){return}q.push({label:t.label||c.getLang("contextMenu."+t.cmdName),className:"edui-for-"+(t.icon?t.icon:t.cmdName+(t.value||"")),onclick:t.exec?function(){t.exec.call(c)}:function(){c.execCommand(t.cmdName,t.value)}})}}}})(f)}if(q[q.length-1]=="-"){q.pop()}d=new UE.ui.Menu({items:q,editor:c});d.render();d.showAt(h);domUtils.preventDefault(o);if(browser.ie){var g;try{g=c.selection.getNative().createRange()}catch(l){return}if(g.item){var k=new dom.Range(c.document);k.selectNode(g.item(0)).select(true,true)}}})};UE.plugins.autoheight=function(){var d=this;d.autoHeightEnabled=d.options.autoHeightEnabled!==false;if(!d.autoHeightEnabled){return}var a,c,b,e=0,f,h;function g(){clearTimeout(h);h=setTimeout(function(){if(d.queryCommandState("source")!=1){if(!c){c=d.document.createElement("span");c.style.cssText="display:block;width:0;margin:0;padding:0;border:0;clear:both;";c.innerHTML="."}b=c.cloneNode(true);d.body.appendChild(b);f=Math.max(domUtils.getXY(b).y+b.offsetHeight,d.options.minFrameHeight);if(f!=e){d.setHeight(f);e=f}domUtils.remove(b)}},50)}d.addListener("destroy",function(){d.removeListener("contentchange",g);d.removeListener("keyup",g);d.removeListener("mouseup",g)});d.enableAutoHeight=function(){if(!d.autoHeightEnabled){return}var i=d.document;d.autoHeightEnabled=true;a=i.body.style.overflowY;i.body.style.overflowY="hidden";d.addListener("contentchange",g);d.addListener("keyup",g);d.addListener("mouseup",g);setTimeout(function(){g()},browser.gecko?100:0);d.fireEvent("autoheightchanged",d.autoHeightEnabled)};d.disableAutoHeight=function(){d.body.style.overflowY=a||"";d.removeListener("contentchange",g);d.removeListener("keyup",g);d.removeListener("mouseup",g);d.autoHeightEnabled=false;d.fireEvent("autoheightchanged",d.autoHeightEnabled)};d.addListener("ready",function(){d.enableAutoHeight();var i;domUtils.on(browser.ie?d.body:d.document,browser.webkit?"dragover":"drop",function(){clearTimeout(i);i=setTimeout(function(){g()},100)})})};UE.plugins.autofloat=function(){var s=this,t=s.getLang();s.setOpt({topOffset:0});var m=s.options.autoFloatEnabled!==false,k=s.options.topOffset;if(!m){return}var f=UE.ui.uiUtils,g=browser.ie&&browser.version<=6,l=browser.quirks;function a(u){if(!u.ui){alert(t.autofloatMsg);return 0}return 1}function h(){var u=document.body.style;u.backgroundImage='url("about:blank")';u.backgroundAttachment="fixed"}var i,n=document.createElement("div"),d,c,r,o=true;function j(){var v=domUtils.getXY(d),u=domUtils.getComputedStyle(d,"position"),w=domUtils.getComputedStyle(d,"left");d.style.width=d.offsetWidth+"px";d.style.zIndex=s.options.zIndex*1+1;d.parentNode.insertBefore(n,d);if(g||(l&&browser.ie)){if(d.style.position!="absolute"){d.style.position="absolute"}d.style.top=(document.body.scrollTop||document.documentElement.scrollTop)-c+k+"px"}else{if(browser.ie7Compat&&o){o=false;d.style.left=domUtils.getXY(d).x-document.documentElement.getBoundingClientRect().left+2+"px"}if(d.style.position!="fixed"){d.style.position="fixed";d.style.top=k+"px";((u=="absolute"||u=="relative")&&parseFloat(w))&&(d.style.left=v.x+"px")}}}function e(){o=true;if(n.parentNode){n.parentNode.removeChild(n)}d.style.cssText=i}function b(){var u=r(s.container);if(u.top<0&&u.bottom-d.offsetHeight>0){j()}else{e()}}var q=utils.defer(function(){b()},browser.ie?200:100,true);s.addListener("destroy",function(){domUtils.un(window,["scroll","resize"],b);s.removeListener("keydown",q)});s.addListener("ready",function(){if(a(s)){r=f.getClientRect;d=s.ui.getDom("toolbarbox");c=r(d).top;i=d.style.cssText;n.style.height=d.offsetHeight+"px";if(g){h()}s.addListener("autoheightchanged",function(v,u){if(u){domUtils.on(window,["scroll","resize"],b);s.addListener("keydown",q)}else{domUtils.un(window,["scroll","resize"],b);s.removeListener("keydown",q)}});s.addListener("beforefullscreenchange",function(v,u){if(u){e()}});s.addListener("fullscreenchanged",function(v,u){if(!u){b()}});s.addListener("sourcemodechanged",function(v,u){setTimeout(function(){b()},0)})}})};UE.plugins.elementpath=function(){var c,a,b=this;b.setOpt("elementPathEnabled",true);if(!b.options.elementPathEnabled){return}b.commands.elementpath={execCommand:function(n,e){var g=a[e],l=b.selection.getRange();b.currentSelectedArr&&domUtils.clearSelectedArr(b.currentSelectedArr);c=e*1;if(dtd.$tableContent[g.tagName]){switch(g.tagName){case"TD":b.currentSelectedArr=[g];g.className=b.options.selectedTdClass;break;case"TR":var o=g.cells;for(var k=0,f;f=o[k++];){b.currentSelectedArr.push(f);f.className=b.options.selectedTdClass}break;case"TABLE":case"TBODY":var q=g.rows;for(var k=0,m;m=q[k++];){o=m.cells;for(var h=0,d;d=o[h++];){b.currentSelectedArr.push(d);d.className=b.options.selectedTdClass}}}g=b.currentSelectedArr[0];if(domUtils.isEmptyNode(g)){l.setStart(g,0).setCursor()}else{l.selectNodeContents(g).select()}}else{l.selectNode(g).select()}},queryCommandValue:function(){var e=[].concat(this.selection.getStartElementPath()).reverse(),h=[];a=e;for(var g=0,f;f=e[g];g++){if(f.nodeType==3){continue}var d=f.tagName.toLowerCase();if(d=="img"&&f.getAttribute("anchorname")){d="anchor"}h[g]=d;if(c==g){c=-1;break}}return h}}};UE.plugins.autolink=function(){var a=0;if(browser.ie){return}var b=this;b.addListener("reset",function(){a=0});b.addListener("keydown",function(j,l){var o=l.keyCode||l.which;if(o==32||o==13){var f=b.selection.getNative(),h=f.getRangeAt(0).cloneRange(),g,n;var d=h.startContainer;while(d.nodeType==1&&h.startOffset>0){d=h.startContainer.childNodes[h.startOffset-1];if(!d){break}h.setStart(d,d.nodeType==1?d.childNodes.length:d.nodeValue.length);h.collapse(true);d=h.startContainer}do{if(h.startOffset==0){d=h.startContainer.previousSibling;while(d&&d.nodeType==1){d=d.lastChild}if(!d||domUtils.isFillChar(d)){break}g=d.nodeValue.length}else{d=h.startContainer;g=h.startOffset}h.setStart(d,g-1);n=h.toString().charCodeAt(0)}while(n!=160&&n!=32);if(h.toString().replace(new RegExp(domUtils.fillChar,"g"),"").match(/(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i)){while(h.toString().length){if(/^(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i.test(h.toString())){break}try{h.setStart(h.startContainer,h.startOffset+1)}catch(i){var d=h.startContainer;while(!(next=d.nextSibling)){if(domUtils.isBody(d)){return}d=d.parentNode}h.setStart(next,0)}}var k=b.document.createElement("a"),m=b.document.createTextNode(" "),c;b.undoManger&&b.undoManger.save();k.appendChild(h.extractContents());k.href=k.innerHTML=k.innerHTML.replace(/<[^>]+>/g,"");c=k.getAttribute("href").replace(new RegExp(domUtils.fillChar,"g"),"");c=/^(?:https?:\/\/)/ig.test(c)?c:"http://"+c;k.setAttribute("data_ue_src",c);k.href=c;h.insertNode(k);k.parentNode.insertBefore(m,k.nextSibling);h.setStart(m,0);h.collapse(true);f.removeAllRanges();f.addRange(h);b.undoManger&&b.undoManger.save()}}})};UE.commands.autosubmit={execCommand:function(){var b=this,a=domUtils.findParentByTagName(b.iframe,"form",false);if(a){if(b.fireEvent("beforesubmit")===false){return}b.sync();a.submit()}}};UE.plugins.undo=function(){var j=this,n=j.options.maxUndoCount||20,i=j.options.maxInputCount||20,e=new RegExp(domUtils.fillChar+"|</hr>","gi"),a=/\b(?:href|src|name)="[^"]*?"/gi;function l(o){var q=this;q.collapsed=o.collapsed;q.startAddr=k(o.startContainer,o.startOffset);q.endAddr=o.collapsed?q.startAddr:k(o.endContainer,o.endOffset)}l.prototype={compare:function(o){if(j.collapsed!==o.collapsed){return 0}if(!g(j.startAddr,o.startAddr)||!g(j.endAddr,o.endAddr)){return 0}return 1},transformRange:function(o){var q=this;o.collapsed=q.collapsed;d(o,"start",q.startAddr);o.collapsed?o.collapse(true):d(o,"end",q.endAddr)}};function k(v,r){for(var t=0,o=[r],s,q=domUtils.findParents(v,true,function(w){return !domUtils.isBody(w)},true);s=q[t++];){if(t==1&&s.nodeType==3){var u=s;while(u=u.previousSibling){if(u.nodeType==3){r+=u.nodeValue.replace(fillCharReg,"").length}else{break}}o[0]=r}o.push(domUtils.getNodeIndex(s,true))}return o.reverse()}function g(s,r){if(s.length!=r.length){return 0}for(var q=0,o=s.length;q<o;q++){if(s[q]!=r[q]){return 0}}return 1}function d(q,u,t){s=q.document.body;for(var r=0,s,o=t.length-1;r<o;r++){s=s.childNodes[t[r]]}q[u+"Container"]=s;q[u+"Offset"]=t[t.length-1]}function c(){this.list=[];this.index=0;this.hasUndo=false;this.hasRedo=false;this.undo=function(){if(this.hasUndo){var q=this.getScene(),o=this.list[this.index];if(o.content.replace(a,"")!=q.content.replace(a,"")){this.save()}if(!this.list[this.index-1]&&this.list.length==1){this.reset();return}while(this.list[this.index].content==this.list[this.index-1].content){this.index--;if(this.index==0){return this.restore(0)}}this.restore(--this.index)}};this.redo=function(){if(this.hasRedo){while(this.list[this.index].content==this.list[this.index+1].content){this.index++;if(this.index==this.list.length-1){return this.restore(this.index)}}this.restore(++this.index)}};this.restore=function(){var u=this.list[this.index];j.document.body.innerHTML=u.bookcontent.replace(e,"");if(browser.ie){for(var q=0,t,v=j.document.getElementsByTagName("p");t=v[q++];){if(t.innerHTML==""){domUtils.fillNode(j.document,t)}}}var o=new dom.Range(j.document);try{if(browser.opera||browser.safari){u.senceRange.transformRange(o)}else{o.moveToBookmark({start:"_baidu_bookmark_start_",end:"_baidu_bookmark_end_",id:true})}if(browser.ie&&browser.version==9&&o.collapsed&&domUtils.isBlockElm(o.startContainer)&&domUtils.isEmptyNode(o.startContainer)){domUtils.fillNode(o.document,o.startContainer)}o.select(!browser.gecko);if(!(browser.opera||browser.safari)){setTimeout(function(){o.scrollToView(j.autoHeightEnabled,j.autoHeightEnabled?domUtils.getXY(j.iframe).y:0)},200)}}catch(s){}this.update();if(j.currentSelectedArr){j.currentSelectedArr=[];var r=j.document.getElementsByTagName("td");for(var q=0,w;w=r[q++];){if(w.className==j.options.selectedTdClass){j.currentSelectedArr.push(w)}}}this.clearKey();j.fireEvent("reset",true)};this.getScene=function(){var q=j.selection.getRange(),o=j.body.innerHTML.replace(e,"");q.shrinkBoundary();browser.ie&&(o=o.replace(/>&nbsp;</g,"><").replace(/\s*</g,"").replace(/>\s*/g,">"));if(browser.opera||browser.safari){return{senceRange:new l(q),content:o,bookcontent:o}}else{var s=q.createBookmark(true,true),r=j.body.innerHTML.replace(e,"");s&&q.moveToBookmark(s).select(true);return{bookcontent:r,content:o}}};this.save=function(){var q=this.getScene(),o=this.list[this.index];if(o&&o.content==q.content&&((browser.opera||browser.safari)?o.senceRange.compare(q.senceRange):o.bookcontent==q.bookcontent)){return}this.list=this.list.slice(0,this.index+1);this.list.push(q);if(this.list.length>n){this.list.shift()}this.index=this.list.length-1;this.clearKey();this.update()};this.update=function(){this.hasRedo=this.list[this.index+1]?true:false;this.hasUndo=this.list[this.index-1]||this.list.length==1?true:false};this.reset=function(){this.list=[];this.index=0;this.hasUndo=false;this.hasRedo=false;this.clearKey()};this.clearKey=function(){f=0;b=null;j.fireEvent("contentchange")}}j.undoManger=new c();function h(){this.undoManger.save()}j.addListener("beforeexeccommand",h);j.addListener("afterexeccommand",h);j.addListener("reset",function(q,o){if(!o){j.undoManger.reset()}});j.commands.redo=j.commands.undo={execCommand:function(o){j.undoManger[o]()},queryCommandState:function(o){return j.undoManger["has"+(o.toLowerCase()=="undo"?"Undo":"Redo")]?0:-1},notNeedUndo:1};var m={16:1,17:1,18:1,37:1,38:1,39:1,40:1,13:1},f=0,b;j.addListener("keydown",function(q,o){var r=o.keyCode||o.which;if(!m[r]&&!o.ctrlKey&&!o.metaKey&&!o.shiftKey&&!o.altKey){if(j.undoManger.list.length==0||((r==8||r==46)&&b!=r)){j.undoManger.save(true);b=r;return}if(j.undoManger.list.length==2&&j.undoManger.index==0&&f==0){j.undoManger.list.splice(1,1);j.undoManger.update()}b=r;f++;if(f>=i){if(j.selection.getRange().collapsed){j.undoManger.save()}}}})};UE.plugins.selectall=function(){var a=this;a.commands.selectall={execCommand:function(){var d=this,b=d.body,c=d.selection.getRange();c.selectNodeContents(b);if(domUtils.isEmptyBlock(b)){if(browser.opera&&b.firstChild&&b.firstChild.nodeType==1){c.setStartAtFirst(b.firstChild)}c.collapse(true)}c.select(true);this.selectAll=true},notNeedUndo:1};a.addListener("ready",function(){domUtils.on(a.document,"click",function(b){a.selectAll=false})})};UE.plugins.keystrokes=function(){var e=this,a=0,d=domUtils.keys,b={B:"strong",I:"em",FONT:"span"},c=[0,10,12,16,18,24,32,48],f={OL:["decimal","lower-alpha","lower-roman","upper-alpha","upper-roman"],UL:["circle","disc","square"]};e.addListener("keydown",function(h,w){var n=w.keyCode||w.which;if(this.selectAll){this.selectAll=false;if((n==8||n==46)){e.undoManger&&e.undoManger.save();e.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>";new dom.Range(e.document).setStart(e.body.firstChild,0).setCursor(false,true);e.undoManger&&e.undoManger.save();browser.ie&&e._selectionChange();domUtils.preventDefault(w);return}}if(n==8){var t=e.selection.getRange(),F,k,j;if(t.collapsed){k=t.startContainer;if(domUtils.isWhitespace(k)){k=k.parentNode}if(domUtils.isEmptyNode(k)&&k===e.body.firstChild){if(k.tagName!="P"){p=e.document.createElement("p");e.body.insertBefore(p,k);domUtils.fillNode(e.document,p);t.setStart(p,0).setCursor(false,true);domUtils.remove(k)}domUtils.preventDefault(w);return}}if(t.collapsed&&t.startContainer.nodeType==3&&t.startContainer.nodeValue.replace(new RegExp(domUtils.fillChar,"g"),"").length==0){t.setStartBefore(t.startContainer).collapse(true)}if(k=t.getClosedNode()){e.undoManger&&e.undoManger.save();t.setStartBefore(k);domUtils.remove(k);t.setCursor();e.undoManger&&e.undoManger.save();domUtils.preventDefault(w);return}if(!browser.ie){k=domUtils.findParentByTagName(t.startContainer,"table",true);j=domUtils.findParentByTagName(t.endContainer,"table",true);if(k&&!j||!k&&j||k!==j){w.preventDefault();return}}if(e.undoManger){if(!t.collapsed){e.undoManger.save();a=1}}}if(n==9){t=e.selection.getRange();e.undoManger&&e.undoManger.save();for(var D=0,u="",x=e.options.tabSize||4,B=e.options.tabNode||"&nbsp;";D<x;D++){u+=B}var C=e.document.createElement("span");C.innerHTML=u;if(t.collapsed){var r=domUtils.findParentByTagName(t.startContainer,"li",true);if(r&&domUtils.isStartInblock(t)){g=t.createBookmark();var A=r.parentNode,E=e.document.createElement(A.tagName);var l=utils.indexOf(f[E.tagName],domUtils.getComputedStyle(A,"list-style-type"));l=l+1==f[E.tagName].length?0:l+1;domUtils.setStyle(E,"list-style-type",f[E.tagName][l]);A.insertBefore(E,r);E.appendChild(r);t.moveToBookmark(g).select()}else{t.insertNode(C.cloneNode(true).firstChild).setCursor(true)}}else{k=domUtils.findParentByTagName(t.startContainer,"table",true);j=domUtils.findParentByTagName(t.endContainer,"table",true);if(k||j){w.preventDefault?w.preventDefault():(w.returnValue=false);return}k=domUtils.findParentByTagName(t.startContainer,["ol","ul"],true);j=domUtils.findParentByTagName(t.endContainer,["ol","ul"],true);if(k&&j&&k===j){var g=t.createBookmark();k=domUtils.findParentByTagName(t.startContainer,"li",true);j=domUtils.findParentByTagName(t.endContainer,"li",true);if(k===k.parentNode.firstChild){var s=e.document.createElement(k.parentNode.tagName);k.parentNode.parentNode.insertBefore(s,k.parentNode);s.appendChild(k.parentNode)}else{A=k.parentNode;E=e.document.createElement(A.tagName);l=utils.indexOf(f[E.tagName],domUtils.getComputedStyle(A,"list-style-type"));l=l+1==f[E.tagName].length?0:l+1;domUtils.setStyle(E,"list-style-type",f[E.tagName][l]);k.parentNode.insertBefore(E,k);var q;while(k!==j){q=k.nextSibling;E.appendChild(k);k=q}E.appendChild(j)}t.moveToBookmark(g).select()}else{if(k||j){w.preventDefault?w.preventDefault():(w.returnValue=false);return}k=domUtils.findParent(t.startContainer,v);j=domUtils.findParent(t.endContainer,v);if(k&&j&&k===j){t.deleteContents();t.insertNode(C.cloneNode(true).firstChild).setCursor(true)}else{var m=t.createBookmark(),v=function(i){return domUtils.isBlockElm(i)};t.enlarge(true);var z=t.createBookmark(),y=domUtils.getNextDomNode(z.start,false,v);while(y&&!(domUtils.getPosition(y,z.end)&domUtils.POSITION_FOLLOWING)){y.insertBefore(C.cloneNode(true).firstChild,y.firstChild);y=domUtils.getNextDomNode(y,false,v)}t.moveToBookmark(z).moveToBookmark(m).select()}}}e.undoManger&&e.undoManger.save();w.preventDefault?w.preventDefault():(w.returnValue=false)}if(browser.gecko&&n==46){t=e.selection.getRange();if(t.collapsed){k=t.startContainer;if(domUtils.isEmptyBlock(k)){var o=k.parentNode;while(domUtils.getChildCount(o)==1&&!domUtils.isBody(o)){k=o;o=o.parentNode}if(k===o.lastChild){w.preventDefault()}return}}}});e.addListener("keyup",function(r,u){var y=u.keyCode||u.which;if(!browser.gecko&&!d[y]&&!u.ctrlKey&&!u.metaKey&&!u.shiftKey&&!u.altKey){o=e.selection.getRange();if(o.collapsed){var h=o.startContainer,j=0;while(!domUtils.isBlockElm(h)){if(h.nodeType==1&&utils.indexOf(["FONT","B","I"],h.tagName)!=-1){var k=e.document.createElement(b[h.tagName]);if(h.tagName=="FONT"){k.style.cssText=(h.getAttribute("size")?"font-size:"+(c[h.getAttribute("size")]||12)+"px":"")+";"+(h.getAttribute("color")?"color:"+h.getAttribute("color"):"")+";"+(h.getAttribute("face")?"font-family:"+h.getAttribute("face"):"")+";"+h.style.cssText}while(h.firstChild){k.appendChild(h.firstChild)}h.parentNode.insertBefore(k,h);domUtils.remove(h);if(!j){o.setEnd(k,k.childNodes.length).collapse(true)}h=k;j=1}h=h.parentNode}j&&o.select()}}if(y==8){if(browser.gecko){for(var m=0,v,x=domUtils.getElementsByTagName(this.body,"li");v=x[m++];){if(domUtils.isEmptyNode(v)&&!v.previousSibling){var w=v.parentNode;domUtils.remove(v);if(domUtils.isEmptyNode(w)){domUtils.remove(w)}}}}var o,h,t,l=this.currentSelectedArr;if(l&&l.length>0){for(var m=0,g;g=l[m++];){g.innerHTML=browser.ie?(browser.version<9?"&#65279":""):"<br/>"}o=new dom.Range(this.document);o.setStart(l[0],0).setCursor();if(a){e.undoManger.save();a=0}if(browser.webkit){u.preventDefault()}return}o=e.selection.getRange();h=o.startContainer;if(domUtils.isWhitespace(h)){h=h.parentNode}var q=0;while(h.nodeType==1&&domUtils.isEmptyNode(h)&&dtd.$removeEmpty[h.tagName]){q=1;t=h.parentNode;domUtils.remove(h);h=t}if(q&&h.nodeType==1&&domUtils.isEmptyNode(h)){if(browser.ie){var s=o.document.createElement("span");h.appendChild(s);o.setStart(h,0).setCursor();v=domUtils.findParentByTagName(h,"li",true);if(v){var n=v.nextSibling;while(n){if(domUtils.isEmptyBlock(n)){v=n;n=n.nextSibling;domUtils.remove(v);continue}break}}}else{h.innerHTML="<br/>";o.setStart(h,0).setCursor(false,true)}setTimeout(function(){if(browser.ie){domUtils.remove(s)}if(a){e.undoManger.save();a=0}},0)}else{if(a){e.undoManger.save();a=0}}}})};UE.plugins.serialize=function(){var n=browser.ie,d=browser.version;function t(v){return/pt/.test(v)?v.replace(/([\d.]+)pt/g,function(w){return Math.round(parseFloat(w)*96/72)+"px"}):v}var u=this,m=u.options.autoClearEmptyNode,g=dtd.$empty,o=function(){var x=/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\s\/>]+)\s*((?:(?:"[^"]*")|(?:'[^']*')|[^"'<>])*)\/?>))/g,v=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,y={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1},B={script:1,style:1},w={li:{"$":"ul",ul:1,ol:1},dd:{"$":"dl",dl:1},dt:{"$":"dl",dl:1},option:{"$":"select",select:1},td:{"$":"tr",tr:1},th:{"$":"tr",tr:1},tr:{"$":"tbody",tbody:1,thead:1,tfoot:1,table:1},tbody:{"$":"table",table:1,colgroup:1},thead:{"$":"table",table:1},tfoot:{"$":"table",table:1},col:{"$":"colgroup",colgroup:1}};var z={table:"td",tbody:"td",thead:"td",tfoot:"td",tr:"td",colgroup:"col",ul:"li",ol:"li",dl:"dd",select:"option"};function A(F,J){var G,H=0,D,O;x.exec("");while((G=x.exec(F))){var M=G.index;if(M>H){var P=F.slice(H,M);if(O){O.push(P)}else{J.onText(P)}}H=x.lastIndex;if((D=G[1])){D=D.toLowerCase();if(O&&D==O._tag_name){J.onCDATA(O.join(""));O=null}if(!O){J.onTagClose(D);continue}}if(O){O.push(G[0]);continue}if((D=G[3])){if(/="/.test(D)){continue}D=D.toLowerCase();var N=G[4],C,E={},L=N&&N.slice(-1)=="/";if(N){v.exec("");while((C=v.exec(N))){var K=C[1].toLowerCase(),I=C[2]||C[3]||C[4]||"";if(!I&&y[K]){I=K}if(K=="style"){if(n&&d<=6){I=I.replace(/(?!;)\s*([\w-]+):/g,function(Q,R){return R.toLowerCase()+":"})}}if(I){E[K]=I.replace(/:\s*/g,":")}}}J.onTagOpen(D,E,L);if(!O&&B[D]){O=[];O._tag_name=D}continue}if((D=G[2])){J.onComment(D)}}if(F.length>H){J.onText(F.slice(H,F.length))}}return function(F,G){var D={type:"fragment",parent:null,children:[]};var E=D;function I(J){J.parent=E;E.children.push(J)}function H(K,J){var L=K;if(w[L.tag]){while(w[E.tag]&&w[E.tag][L.tag]){E=E.parent}if(E.tag==L.tag){E=E.parent}while(w[L.tag]){if(w[L.tag][E.tag]){break}L=L.parent={type:"element",tag:w[L.tag]["$"],attributes:{},children:[L]}}}if(G){while(dtd[L.tag]&&!(E.tag=="span"?utils.extend(dtd.strong,{a:1,A:1}):(dtd[E.tag]||dtd.div))[L.tag]){if(C(E)){continue}if(!E.parent){break}E=E.parent}}L.parent=E;E.children.push(L);if(J){E=K}if(K.attributes.style){K.attributes.style=K.attributes.style.toLowerCase()}return K}function C(J){var K;if(!J.children.length&&(K=z[J.tag])){H({type:"element",tag:K,attributes:{},children:[]},true);return true}return false}A(F,{onText:function(J){while(!(dtd[E.tag]||dtd.div)["#"]){if(C(E)){continue}E=E.parent}I({type:"text",data:J})},onComment:function(J){I({type:"comment",data:J})},onCDATA:function(J){while(!(dtd[E.tag]||dtd.div)["#"]){if(C(E)){continue}E=E.parent}I({type:"cdata",data:J})},onTagOpen:function(J,L,K){K=K||g[J];H({type:"element",tag:J,attributes:L,closed:K,children:[]},!K)},onTagClose:function(J){var K=E;while(K&&J!=K.tag){K=K.parent}if(K){for(var L=E;L!==K.parent;L=L.parent){C(L)}E=K.parent}else{if(!(dtd.$removeEmpty[J]||dtd.$removeEmptyBlock[J]||J=="embed")){K={type:"element",tag:J,attributes:{},children:[]};H(K,true);C(K);E=K.parent}}}});while(E!==D){C(E);E=E.parent}return D}}();var j=function(){var w={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function v(x){return w[x]}return function(x){x=x+"";return x?x.replace(/[<>"']/g,v):""}}();var l=function(){function w(E,D){var C=E.children;var F=[];for(var B=0,A;A=C[B];B++){F.push(l(A,D))}return F.join("")}function x(B){var D=[];for(var A in B){var C=B[A];if(A=="style"){C=t(C);if(/rgba?\s*\([^)]*\)/.test(C)){C=C.replace(/rgba?\s*\(([^)]*)\)/g,function(E){return utils.fixColor("color",E)})}B[A]=utils.optCss(C.replace(/windowtext/g,"#000")).replace(/white-space[^;]+;/g,"")}D.push(A+'="'+j(B[A])+'"')}return D.join(" ")}function v(B,A){return A?B.data.replace(/&nbsp;/g," "):j(B.data).replace(/ /g,"&nbsp;")}var z={div:"p",li:"p",tr:"p",br:"br",p:"p"};function y(E,D){if(E.type=="element"&&!E.children.length&&(dtd.$removeEmpty[E.tag])&&E.tag!="a"&&utils.isEmptyObject(E.attributes)&&m){return C}var A=E.tag;if(D&&A=="td"){if(!C){C=""}C+=w(E,D)+"&nbsp;&nbsp;&nbsp;"}else{var B=x(E.attributes);var C="<"+(D&&z[A]?z[A]:A)+(B?" "+B:"")+(g[A]?" />":">");if(!g[A]){if(A=="p"&&!E.children.length){C+=browser.ie?"&nbsp;":"<br/>"}C+=w(E,D);C+="</"+(D&&z[A]?z[A]:A)+">"}}return C}return function(B,A){if(B.type=="fragment"){return w(B,A)}else{if(B.type=="element"){return y(B,A)}else{if(B.type=="text"||B.type=="cdata"){return v(B,dtd.$notTransContent[B.parent.tag])}else{if(B.type=="comment"){return"<!--"+B.data+"-->"}}}}return""}}();var h=function(){function w(z){var y=new RegExp(/(class="?Mso|style="[^"]*\bmso\-|w:WordDocument|<v:)/ig);return y.test(z)}function x(y){y=y.replace(/([\d.]+)([\w]+)?/g,function(z,B,A){return(Math.round(parseFloat(B))||1)+(A||"px")});return y}function v(y){y=y.replace(/<!--\s*EndFragment\s*-->[\s\S]*$/,"").replace(/^(\r\n|\n|\r)|(\r\n|\n|\r)$/ig,"").replace(/^\s*(&nbsp;)+/ig,"").replace(/(&nbsp;|<br[^>]*>)+\s*$/ig,"").replace(/<!--[\s\S]*?-->/ig,"").replace(/<v:shape [^>]*>[\s\S]*?.<\/v:shape>/gi,function(D){if(browser.opera){return""}try{var A=D.match(/width:([ \d.]*p[tx])/i)[1],z=D.match(/height:([ \d.]*p[tx])/i)[1],C=D.match(/src=\s*"([^"]*)"/i)[1];return'<img width="'+t(A)+'" height="'+t(z)+'" src="'+C+'" />'}catch(B){return""}}).replace(/v:\w+=["']?[^'"]+["']?/g,"").replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|xml|meta|link|style|\w+:\w+)(?=[\s\/>]))[^>]*>/gi,"").replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>").replace(/(lang)\s*=\s*([\'\"]?)[\w-]+\2/ig,"").replace(/<font[^>]*>\s*<\/font>/gi,"").replace(/class\s*=\s*["']?(?:(?:MsoTableGrid)|(?:MsoListParagraph)|(?:MsoNormal(Table)?))\s*["']?/gi,"");y=y.replace(/(<[a-z][^>]*)\sstyle=(["'])([^\2]*?)\2/gi,function(F,J,D,A){var B=[],E=0,I=A.replace(/^\s+|\s+$/,"").replace(/&quot;/gi,"'").split(/;\s*/g);for(var E=0;E<I.length;E++){var H=I[E];var z,G,C=H.split(":");if(C.length==2){z=C[0].toLowerCase();G=C[1].toLowerCase();switch(z){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":if(!/<table/.test(J)){B[E]=z.replace(/^mso-|-alt$/g,"")+":"+x(G)}continue;case"horiz-align":B[E]="text-align:"+G;continue;case"vert-align":B[E]="vertical-align:"+G;continue;case"font-color":case"mso-foreground":B[E]="color:"+G;continue;case"mso-background":case"mso-highlight":B[E]="background:"+G;continue;case"mso-default-height":B[E]="min-height:"+x(G);continue;case"mso-default-width":B[E]="min-width:"+x(G);continue;case"mso-padding-between-alt":B[E]="border-collapse:separate;border-spacing:"+x(G);continue;case"text-line-through":if((G=="single")||(G=="double")){B[E]="text-decoration:line-through"}continue;case"mso-zero-height":if(G=="yes"){B[E]="display:none"}continue;case"margin":if(!/[1-9]/.test(C[1])){continue}}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?:decor|trans)|top-bar|version|vnd|word-break)/.test(z)){continue}if(/text\-indent|padding|margin/.test(z)&&/\-[\d.]+/.test(G)){continue}B[E]=z+":"+C[1]}}if(E>0){return J+' style="'+B.join(";")+'"'}else{return J}});y=y.replace(/([ ]+)<\/span>/ig,function(z,A){return new Array(A.length+1).join("&nbsp;")+"</span>"});return y}return function(y){f=null;s="",i="",q="";if(w(y)){y=v(y)}return y.replace(/>[ \t\r\n]*</g,"><")}}();var c={text:"#text",comment:"#comment",cdata:"#cdata-section",fragment:"#document-fragment"};var f,s="",i="",q;function e(y,z){var B=[0,10,12,16,18,24,32,48],A,D=utils.indexOf;switch(y.tag){case"script":y.tag="div";y.attributes._ue_div_script=1;y.attributes._ue_script_data=y.children[0]?encodeURIComponent(y.children[0].data):"";y.attributes._ue_custom_node_=1;y.children=[];break;case"style":y.tag="div";y.attributes._ue_div_style=1;y.attributes._ue_style_data=y.children[0]?encodeURIComponent(y.children[0].data):"";y.attributes._ue_custom_node_=1;y.children=[];break;case"img":if(y.attributes.src&&/^data:/.test(y.attributes.src)){return{type:"fragment",children:[]}}if(y.attributes.src&&/^(?:file)/.test(y.attributes.src)){if(!/(gif|bmp|png|jpg|jpeg)$/.test(y.attributes.src)){return{type:"fragment",children:[]}}y.attributes.word_img=y.attributes.src;y.attributes.src=u.options.UEDITOR_HOME_URL+"themes/default/images/spacer.gif";var C=parseInt(y.attributes.width)<128||parseInt(y.attributes.height)<43;y.attributes.style="background:url("+(C?u.options.UEDITOR_HOME_URL+"themes/default/images/word.gif":u.options.langPath+u.options.lang+"/images/localimage.png")+") no-repeat center center;border:1px solid #ddd";z&&(z.flag=1)}if(browser.ie&&browser.version<7){y.attributes.orgSrc=y.attributes.src}y.attributes.data_ue_src=y.attributes.data_ue_src||y.attributes.src;break;case"li":var w=y.children[0];if(!w||w.type!="element"||w.tag!="p"&&dtd.p[w.tag]){var x={type:"element",tag:"p",attributes:{},parent:y};x.children=w?y.children:[browser.ie?{type:"text",data:domUtils.fillChar,parent:x}:{type:"element",tag:"br",attributes:{},closed:true,children:[],parent:x}];y.children=[x]}break;case"table":case"td":a(y);break;case"a":if(y.attributes.anchorname){y.tag="img";y.attributes={"class":"anchorclass",anchorname:y.attributes.name};y.closed=1}y.attributes.href&&(y.attributes.data_ue_src=y.attributes.href);break;case"b":y.tag=y.name="strong";break;case"i":y.tag=y.name="em";break;case"u":y.tag=y.name="span";y.attributes.style=(y.attributes.style||"")+";text-decoration:underline;";break;case"s":case"del":y.tag=y.name="span";y.attributes.style=(y.attributes.style||"")+";text-decoration:line-through;";if(y.children.length==1){w=y.children[0];if(w.tag==y.tag){y.attributes.style+=";"+w.attributes.style;y.children=w.children}}break;case"span":var v=y.attributes.style;if(v){if(!y.attributes.style||browser.webkit&&v=="white-space:nowrap;"){delete y.attributes.style}}if(browser.gecko&&browser.version<=10902&&y.parent){var E=y.parent;if(E.tag=="span"&&E.attributes&&E.attributes.style){y.attributes.style=E.attributes.style+";"+y.attributes.style}}if(utils.isEmptyObject(y.attributes)&&m){y.type="fragment"}break;case"font":y.tag=y.name="span";A=y.attributes;y.attributes={style:(A.size?"font-size:"+(B[A.size]||12)+"px":"")+";"+(A.color?"color:"+A.color:"")+";"+(A.face?"font-family:"+A.face:"")+";"+(A.style||"")};while(y.parent.tag==y.tag&&y.parent.children.length==1){y.attributes.style&&(y.parent.attributes.style?(y.parent.attributes.style+=";"+y.attributes.style):(y.parent.attributes.style=y.attributes.style));y.parent.children=y.children;y=y.parent}break;case"p":if(y.attributes.align){y.attributes.style=(y.attributes.style||"")+";text-align:"+y.attributes.align+";";delete y.attributes.align}}return y}function a(w){if(n&&w.attributes.style){var v=w.attributes.style;w.attributes.style=v.replace(/;\s*/g,";");w.attributes.style=w.attributes.style.replace(/^\s*|\s*$/,"")}}function k(v){switch(v.tag){case"div":if(v.attributes._ue_div_script){v.tag="script";v.children=[{type:"cdata",data:v.attributes._ue_script_data?decodeURIComponent(v.attributes._ue_script_data):"",parent:v}];delete v.attributes._ue_div_script;delete v.attributes._ue_script_data;delete v.attributes._ue_custom_node_}if(v.attributes._ue_div_style){v.tag="style";v.children=[{type:"cdata",data:v.attributes._ue_style_data?decodeURIComponent(v.attributes._ue_style_data):"",parent:v}];delete v.attributes._ue_div_style;delete v.attributes._ue_style_data;delete v.attributes._ue_custom_node_}break;case"table":!v.attributes.style&&delete v.attributes.style;if(n&&v.attributes.style){a(v)}if(v.attributes["class"]=="noBorderTable"){delete v.attributes["class"]}break;case"td":case"th":if(/display\s*:\s*none/i.test(v.attributes.style)){return{type:"fragment",children:[]}}if(n&&!v.children.length){var w={type:"text",data:domUtils.fillChar,parent:v};v.children[0]=w}if(n&&v.attributes.style){a(v)}if(v.attributes["class"]=="selectTdClass"){delete v.attributes["class"]}break;case"img":if(v.attributes.anchorname){v.tag="a";v.attributes={name:v.attributes.anchorname,anchorname:1};v.closed=null}else{if(v.attributes.data_ue_src){v.attributes.src=v.attributes.data_ue_src;delete v.attributes.data_ue_src}}break;case"a":if(v.attributes.data_ue_src){v.attributes.href=v.attributes.data_ue_src;delete v.attributes.data_ue_src}}return v}function b(B,A,v){if(!B.children||!B.children.length){return B}var z=B.children;for(var y=0;y<z.length;y++){var x=A(z[y],v);if(x.type=="fragment"){var w=[y,1];w.push.apply(w,x.children);z.splice.apply(z,w);if(!z.length){B={type:"fragment",children:[]}}y--}else{z[y]=x}}return B}function r(v){this.rules=v}r.prototype={rules:null,filter:function(x,A,z){A=A||this.rules;var w=A&&A.whiteList;var v=A&&A.blackList;function y(F,E){F.name=F.type=="element"?F.tag:c[F.type];if(E==null){return b(F,y,F)}if(v&&v[F.name]){z&&(z.flag=1);return{type:"fragment",children:[]}}if(w){if(F.type=="element"){if(E.type=="fragment"?w[F.name]:w[F.name]&&w[E.name][F.name]){var D;if((D=w[F.name].$)){var G=F.attributes;var C={};for(var B in D){if(G[B]){C[B]=G[B]}}F.attributes=C}}else{z&&(z.flag=1);F.type="fragment";F.name=E.name}}else{}}if(v||w){b(F,y,F)}return F}return y(x,null)},transformInput:function(w,v){function x(y){y=e(y,v);y=b(y,x,y);if(u.options.pageBreakTag&&y.type=="text"&&y.data.replace(/\s/g,"")==u.options.pageBreakTag){y.type="element";y.name=y.tag="hr";delete y.data;y.attributes={"class":"pagebreak",noshade:"noshade",size:"5",unselectable:"on",style:"moz-user-select:none;-khtml-user-select: none;"};y.children=[]}if(y.type=="text"&&!dtd.$notTransContent[y.parent.tag]){y.data=y.data.replace(/[\r\t\n]*/g,"")}return y}return x(w)},transformOutput:function(v){function w(x){if(x.tag=="hr"&&x.attributes["class"]=="pagebreak"){delete x.tag;x.type="text";x.data=u.options.pageBreakTag;delete x.children}x=k(x);if(x.tag=="ol"||x.tag=="ul"){f=1}x=b(x,w,x);if(x.tag=="ol"||x.tag=="ul"){f=0}return x}return w(v)},toHTML:l,parseHTML:o,word:h};u.serialize=new r(u.options.serialize||{});UE.serialize=new r({})};(function(){function a(f){var d=this.document;if(d.getElementById("baidu_pastebin")){return}var c=this.selection.getRange(),b=c.createBookmark(),e=d.createElement("div");e.id="baidu_pastebin";browser.webkit&&e.appendChild(d.createTextNode(domUtils.fillChar+domUtils.fillChar));d.body.appendChild(e);b.start.style.display="";e.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;left:-1000px;white-space:nowrap;top:"+domUtils.getXY(b.start).y+"px";c.selectNodeContents(e).select(true);setTimeout(function(){if(browser.webkit){for(var g=0,h=d.querySelectorAll("#baidu_pastebin"),k;k=h[g++];){if(domUtils.isEmptyNode(k)){domUtils.remove(k)}else{e=k;break}}}try{e.parentNode.removeChild(e)}catch(j){}c.moveToBookmark(b).select(true);f(e)},0)}UE.plugins.paste=function(){var f=this;var e={flag:""};var d=f.options.pasteplain===true;var b={flag:""};f.commands.pasteplain={queryCommandState:function(){return d},execCommand:function(){d=!d|0},notNeedUndo:1};function c(r){var q;if(r.firstChild){var u=domUtils.getElementsByTagName(r,"span");for(var x=0,k;k=u[x++];){if(k.id=="_baidu_cut_start"||k.id=="_baidu_cut_end"){domUtils.remove(k)}}if(browser.webkit){var s=r.querySelectorAll("div br");for(var x=0,h;h=s[x++];){var o=h.parentNode;if(o.tagName=="DIV"&&o.childNodes.length==1){o.innerHTML="<p><br/></p>";domUtils.remove(o)}}var w=r.querySelectorAll("#baidu_pastebin");for(var x=0,y;y=w[x++];){var B=f.document.createElement("p");y.parentNode.insertBefore(B,y);while(y.firstChild){B.appendChild(y.firstChild)}domUtils.remove(y)}var g=r.querySelectorAll("meta");for(var x=0,n;n=g[x++];){domUtils.remove(n)}var s=r.querySelectorAll("br");for(x=0;n=s[x++];){if(/^apple-/.test(n)){domUtils.remove(n)}}}if(browser.gecko){var t=r.querySelectorAll("[_moz_dirty]");for(x=0;n=t[x++];){n.removeAttribute("_moz_dirty")}}if(!browser.ie){var m=r.querySelectorAll("span.apple-style-span");for(var x=0,n;n=m[x++];){domUtils.remove(n,true)}}q=r.innerHTML;var z=f.serialize;if(z){try{var v=z.transformInput(z.parseHTML(z.word(q)),e);v=z.filter(v,d?{whiteList:{p:{br:1,BR:1,$:{}},br:{"$":{}},div:{br:1,BR:1,"$":{}},li:{"$":{}},tr:{td:1,"$":{}},td:{"$":{}}},blackList:{style:1,script:1,object:1}}:null,!d?b:null);if(browser.webkit){var j=v.children.length,l;while((l=v.children[j-1])&&l.tag=="br"){v.children.splice(j-1,1);j=v.children.length}}q=z.toHTML(v,d)}catch(A){}}q={html:q};f.fireEvent("beforepaste",q);f.execCommand("insertHtml",q.html,true);f.fireEvent("afterpaste")}}f.addListener("ready",function(){domUtils.on(f.body,"cut",function(){var g=f.selection.getRange();if(!g.collapsed&&f.undoManger){f.undoManger.save()}});domUtils.on(f.body,browser.ie||browser.opera?"keydown":"paste",function(g){if((browser.ie||browser.opera)&&(!g.ctrlKey||g.keyCode!="86")){return}a.call(f,function(h){c(h)})})})}})();UE.plugins.fiximgclick=function(){var a=this;if(browser.webkit){a.addListener("click",function(c,d){if(d.target.tagName=="IMG"){var b=new dom.Range(a.document);b.selectNode(d.target).select()}})}};UE.plugins.enterkey=function(){var b,c=this,a=c.options.enterTag;c.addListener("keyup",function(l,m){var n=m.keyCode||m.which;if(n==13){var k=c.selection.getRange(),g=k.startContainer,d;if(!browser.ie){if(/h\d/i.test(b)){if(browser.gecko){var j=domUtils.findParentByTagName(g,["h1","h2","h3","h4","h5","h6","blockquote"],true);if(!j){c.document.execCommand("formatBlock",false,"<p>");d=1}}else{if(g.nodeType==1){var i=c.document.createTextNode(""),e;k.insertNode(i);e=domUtils.findParentByTagName(i,"div",true);if(e){var f=c.document.createElement("p");while(e.firstChild){f.appendChild(e.firstChild)}e.parentNode.insertBefore(f,e);domUtils.remove(e);k.setStartBefore(i).setCursor();d=1}domUtils.remove(i)}}if(c.undoManger&&d){c.undoManger.save()}}browser.opera&&k.select()}setTimeout(function(){c.selection.getRange().scrollToView(c.autoHeightEnabled,c.autoHeightEnabled?domUtils.getXY(c.iframe).y:0)},50)}});c.addListener("keydown",function(i,k){var m=k.keyCode||k.which;if(m==13){if(c.undoManger){c.undoManger.save()}b="";var f=c.selection.getRange();if(!f.collapsed){var d=f.startContainer,e=f.endContainer,g=domUtils.findParentByTagName(d,"td",true),h=domUtils.findParentByTagName(e,"td",true);if(g&&h&&g!==h||!g&&h||g&&!h){k.preventDefault?k.preventDefault():(k.returnValue=false);return}}c.currentSelectedArr&&domUtils.clearSelectedArr(c.currentSelectedArr);if(a=="p"){if(!browser.ie){d=domUtils.findParentByTagName(f.startContainer,["ol","ul","p","h1","h2","h3","h4","h5","h6","blockquote"],true);if(!d&&!browser.opera){c.document.execCommand("formatBlock",false,"<p>");if(browser.gecko){f=c.selection.getRange();d=domUtils.findParentByTagName(f.startContainer,"p",true);d&&domUtils.removeDirtyAttr(d)}}else{b=d.tagName;d.tagName.toLowerCase()=="p"&&browser.gecko&&domUtils.removeDirtyAttr(d)}}}else{k.preventDefault?k.preventDefault():(k.returnValue=false);if(!f.collapsed){f.deleteContents();d=f.startContainer;if(d.nodeType==1&&(d=d.childNodes[f.startOffset])){while(d.nodeType==1){if(dtd.$empty[d.tagName]){f.setStartBefore(d).setCursor();if(c.undoManger){c.undoManger.save()}return false}if(!d.firstChild){var l=f.document.createElement("br");d.appendChild(l);f.setStart(d,0).setCursor();if(c.undoManger){c.undoManger.save()}return false}d=d.firstChild}if(d===f.startContainer.childNodes[f.startOffset]){l=f.document.createElement("br");f.insertNode(l).setCursor()}else{f.setStart(d,0).setCursor()}}else{l=f.document.createElement("br");f.insertNode(l).setStartAfter(l).setCursor()}}else{l=f.document.createElement("br");f.insertNode(l);var j=l.parentNode;if(j.lastChild===l){l.parentNode.insertBefore(l.cloneNode(true),l);f.setStartBefore(l)}else{f.setStartAfter(l)}f.setCursor()}}}})};UE.commands["delete"]={execCommand:function(){var f=this.selection.getRange(),d=0,j=0,h=this;if(this.selectAll){h.body.innerHTML="<p>"+(browser.ie?"&nbsp;":"<br/>")+"</p>";f.setStart(h.body.firstChild,0).setCursor(false,true);h.selectAll=false;return}if(h.currentSelectedArr&&h.currentSelectedArr.length>0){for(var e=0,l;l=h.currentSelectedArr[e++];){if(l.style.display!="none"){l.innerHTML=browser.ie?domUtils.fillChar:"<br/>"}}f.setStart(h.currentSelectedArr[0],0).setCursor();return}if(f.collapsed){return}f.txtToElmBoundary();while(!f.startOffset&&!domUtils.isBody(f.startContainer)&&!dtd.$tableContent[f.startContainer.tagName]){d=1;f.setStartBefore(f.startContainer)}while(f.endContainer.nodeType!=3&&!domUtils.isBody(f.endContainer)&&!dtd.$tableContent[f.endContainer.tagName]){var b,k=f.endContainer,g=f.endOffset;b=k.childNodes[g];if(!b||domUtils.isBr(b)&&k.lastChild===b){f.setEndAfter(k);continue}break}if(d){var a=h.document.createElement("span");a.innerHTML="start";a.id="_baidu_cut_start";f.insertNode(a).setStartBefore(a)}if(j){var c=h.document.createElement("span");c.innerHTML="end";c.id="_baidu_cut_end";f.cloneRange().collapse(false).insertNode(c);f.setEndAfter(c)}f.deleteContents();if(domUtils.isBody(f.startContainer)&&domUtils.isEmptyBlock(h.body)){h.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>";f.setStart(h.body.firstChild,0).collapse(true)}else{if(!browser.ie&&domUtils.isEmptyBlock(f.startContainer)){f.startContainer.innerHTML="<br/>"}}f.select(true)},queryCommandState:function(){if(this.currentSelectedArr&&this.currentSelectedArr.length>0){return 0}return this.highlight||this.selection.getRange().collapsed?-1:0}};UE.commands.inserthtml={execCommand:function(a,g,t){var u=this,h,j,o=u.currentSelectedArr;h=u.selection.getRange();j=h.document.createElement("div");j.style.display="inline";var m=u.serialize;if(!t&&m){var n=m.parseHTML(g);n=m.transformInput(n);n=m.filter(n);g=m.toHTML(n)}j.innerHTML=utils.trim(g);try{u.adjustTable&&u.adjustTable(j)}catch(r){}if(o&&o.length){for(var q=0,c;c=o[q++];){c.className=""}o[0].innerHTML="";h.setStart(o[0],0).collapse(true);u.currentSelectedArr=[]}if(!h.collapsed){h.deleteContents();if(h.startContainer.nodeType==1){var d=h.startContainer.childNodes[h.startOffset],k;if(d&&domUtils.isBlockElm(d)&&(k=d.previousSibling)&&domUtils.isBlockElm(k)){h.setEnd(k,k.childNodes.length).collapse();while(d.firstChild){k.appendChild(d.firstChild)}domUtils.remove(d)}}}var d,f,k,s,b=0;while(d=j.firstChild){h.insertNode(d);if(!b&&d.nodeType==domUtils.NODE_ELEMENT&&domUtils.isBlockElm(d)){f=domUtils.findParent(d,function(e){return domUtils.isBlockElm(e)});if(f&&f.tagName.toLowerCase()!="body"&&!(dtd[f.tagName][d.nodeName]&&d.parentNode===f)){if(!dtd[f.tagName][d.nodeName]){k=f}else{s=d.parentNode;while(s!==f){k=s;s=s.parentNode}}domUtils.breakParent(d,k||s);var k=d.previousSibling;domUtils.trimWhiteTextNode(k);if(!k.childNodes.length){domUtils.remove(k)}if(!browser.ie&&(l=d.nextSibling)&&domUtils.isBlockElm(l)&&l.lastChild&&!domUtils.isBr(l.lastChild)){l.appendChild(u.document.createElement("br"))}b=1}}var l=d.nextSibling;if(!j.firstChild&&l&&domUtils.isBlockElm(l)){h.setStart(l,0).collapse(true);break}h.setEndAfter(d).collapse()}d=h.startContainer;if(domUtils.isBlockElm(d)&&domUtils.isEmptyNode(d)){d.innerHTML=browser.ie?"":"<br/>"}h.select(true);setTimeout(function(){h=u.selection.getRange();h.scrollToView(u.autoHeightEnabled,u.autoHeightEnabled?domUtils.getXY(u.iframe).y:0)},200)}};UE.plugins.shortcutkeys=function(){var b=this,a={"ctrl+66":"Bold","ctrl+90":"Undo","ctrl+89":"Redo","ctrl+73":"Italic","ctrl+85":"Underline","ctrl+shift+67":"removeformat","ctrl+shift+76":"justify:left","ctrl+shift+82":"justify:right","ctrl+65":"selectAll","ctrl+13":"autosubmit"};b.addListener("keydown",function(d,h){var g=h.keyCode||h.which,f;for(var c in a){if(/^(ctrl)(\+shift)?\+(\d+)$/.test(c.toLowerCase())||/^(\d+)$/.test(c)){if(((RegExp.$1=="ctrl"?(h.ctrlKey||h.metaKey||browser.opera&&g==17):0)&&(RegExp.$2!=""?h[RegExp.$2.slice(1)+"Key"]:1)&&g==RegExp.$3)||g==RegExp.$1){f=a[c].split(":");b.execCommand(f[0],f[1]);domUtils.preventDefault(h)}}}})};